Skip to main content

Windows Scripting

Boot & Error History

Hit that Windows key and type in "Reliability History" this will open "Reliability Monitor." If you type "Reliability Monitor", nothing comes up lol.

The Reliability Monitor will give you 1 year of graphs charting out hardware and software related issues. This is inclusive of software and hardware issues (e.g., Windows Diagnosis, Hardware Error). If you want more than 1 year of history, the bottom left of the window has a "Save reliability history" button – this saves a log of all issues into a nice and easy-to-read (not sarcastic) XML file. Obviously, this only goes back as far as when you installed Windows. If you wipe your drive, this all goes away. 

To get an even finer comb, hit the Windows + R keys and type "eventvwr.msc". From there, you can create custom views. Set the event level to Critical, Warning, Error then By Log, Event Logs="Application,System" and then set the event ID to "41" to find all the naughty shut-downs. 

Naughty C: Drive

Run Powershell as an Admin to check if bad shutdown
fsutil dirty query C:
Result : "not dirty" is good

Run Command Prompt as an Admin to verify system 

sfc /scannow

Wait for results, then
Dism.exe /online /cleanup-image /CheckHealth

Wait for results, then
Dism.exe /online /cleanup-image /ScanHealth

Wait for results, then
Dism.exe /online /cleanup-image /RestoreHealth

Wait for results, then
chkntfs /x C:

Naughty RAM

Download MemTest, install it on a thumb drive using the included exe (this will format a thumb for you). Launch your BIOS’ boot options and boot from the thumbdrive. Wait a while. Now you know which RAM is the naughtiest. Replace it!

Windows Bootable Recovery

Windows has a built-in recovery partition, just like a Mac, but sometimes (if not frequently), that recovery partition gets borked and you need to reinstall a fresh version of Windows. To do this, from another Windows PC, download the Create Windows Media tool here, and plug-in a USB flash drive that’s 8Gb or greater (and that you’re happy to reformat). Then, you can run the MediaCreationTool, and it will take care of the rest (including formatting your thumb drive). When finished, plug that bad boy into the problematic machine, and select the drive in the boot menu. From there: good luck!

You’ve Got A Ton Of Displays And The Window You Want is On the Wrong God-Damn Display and You Can’t Find It Anywhere, Or Your Mouse Is Hidden: Where The Fuck Did It Go?

See windows hotkeys here. Or login to the computer via a VNC client that allows you to see all screens at once 😀

Launch Some Application or Document on Startup

Windows+R, then type “shell:startup” – then throw a shortcut to that app or doc in that folder. Donezo. 

Auto Restart With A Delay Via a Bat Script

Useful for battle testing a computer with a naughty power supply. 

@echo off
echo Your computer will restart in 2 minutes. Press Ctrl+C to cancel now.
timeout /t 30
shutdown /r /f /t 90 /c "Restarting in 2 minutes. Cancelled if interrupted."

Auto Launch Some Applications With A Delay Via a Bat Script

Open up notepad, copy and paste the below code, replace with whatever file(s) + path(s) and whatever startup delays you want, save it as a .bat and throw it in shell:startup. I recommend doing a test with some garbage.txt files first just to make sure you did it right!

@echo off
timeout /t 30 /nobreak
start "" "C:\Users\CAM\Desktop\garbage.txt"
timeout /t 30 /nobreak
start "" "C:\Users\CAM\Desktop\garbage-2.txt"

Disabling Windows Update

Last tested using Windows 10 in January 2025 – 

Obviously, there are serious issues that can be caused by disabling Windows Update, but if you’re installing a stable installation and you’re ideally quarantining it from the greater net, then disabling Windows Update might be necessary. A random update could break the whole install! 

First, you can disable it from running automatically when starting with the system. This works, but if you open Windows Update it will manually relaunch it. Not ideal. 

    Open the Services Manager:
      Press Win + R, type services.msc, and hit Enter. Locate Windows Update Service:
        Scroll down to find Windows Update in the list. Disable the Service:
          Right-click on Windows Update and select Properties. Under the General tab, set the Startup type to Disabled. Click Stop if the service is currently running. Click Apply and OK. Reboot the Computer to ensure the changes take effect.

          Then, you can disable it at an admin level so that it appears to be managed by group permissions. This seems to prevent automatic updates, but it seems to allow you to update manually. 

            Open the Group Policy Editor:
              Press Win + R, type gpedit.msc, and hit Enter. Navigate to Windows Update Settings:
                Go to Computer Configuration → Administrative Templates → Windows Components → Windows Update. Modify Update Settings:
                  Double-click on Configure Automatic Updates. Select Disabled, then click Apply and OK. Reboot the Computer to ensure the changes take effect.

                  Since that doesn’t completely kill it, you need to manually move the executable, or rename it. Permissions to do this are controlled by the system, so you can’t change it via properties. Instead, you have to do it using the command prompt run as administrator. This also gives you the ability to change the name back at a later date if you decide you do want to update Windows. Open Command

                    Open Command Prompt as Administrator: Take Ownership:
                      takeown /f C:\Windows\System32\wuaueng.dll Grant Permissions:
                        icacls C:\Windows\System32\wuaueng.dll /grant %username%:F if you’re username is “cam” then the string is icacls C:\Windows\System32\wuaueng.dll /grant cam:F Rename the File:
                          ren C:\Windows\System32\wuaueng.dll wuaueng.dll.bak Restart the Computer.

                          Always Works Method for Setting Up Windows Auto-Login

                          (If login creds need to change, do that first - just press the Windows key and type in change password and a system setting will pop up). 

                          You can do the following insane effort … or run this utility from the Microsoft site called “Autologon” 🤦‍♀️

                            Press Windows+R and type in regedit Select the path at top, delete it and paste: 
                            HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\PasswordLess\Device Find the entry: DevicePasswordLessBuildVersion DWORD  Double-click on DevicePasswordLessBuildVersion and change its value from 2 to 0 Close regedit  RESTART  Windows+R and type netplwiz Turn off checkbox to require password on login. If it’s already off, toggle it on and then off again. Either way, it will ask for your credentials.  ** REBOOT TO CONFIRM ** sometimes a slow reboot

                            This has worked 100% of the time on different server configs. If it doesn’t, you can also try:

                              Run Regedit. Copy and paste this path:
                              HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
                              Find the entry DefaultPassword Make sure it’s the right password Find the entry DefaultUserName Make sure it’s the right user name If neither entry is there, you can create the entries by right-clicking and creating a new string item.