Skip to content

Instantly share code, notes, and snippets.

@Marshall-Hallenbeck
Last active May 12, 2026 12:43
Show Gist options
  • Select an option

  • Save Marshall-Hallenbeck/de943c948854c5b75f071475ee35699f to your computer and use it in GitHub Desktop.

Select an option

Save Marshall-Hallenbeck/de943c948854c5b75f071475ee35699f to your computer and use it in GitHub Desktop.
NOT WORKING - Prevent Automatic Shutdown for Expired Windows Evaluation VMs
# Create PS folder on C: drive
New-Item -ItemType Directory -Force -Path "C:\PS"
# Set TLS versions for download (it will error otherwise)
[Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls"
# Download PsTools
Invoke-WebRequest -Uri "https://download.sysinternals.com/files/PSTools.zip" -OutFile "C:\PS\PSTools.zip"
# Extract PsTools to the PS folder
Expand-Archive -Path "C:\PS\PSTools.zip" -DestinationPath "C:\PS"
# Auto Accept EULA, can also run psexec with -accepteula
#reg ADD HKCU\Software\Sysinternals\PSexec /v EulaAccepted /t REG_DWORD /d 1 /f
# Start a new command prompt with Administrator privileges and run the commands
Start-Process -FilePath "cmd.exe" -Verb RunAs -ArgumentList '/c c: && cd / && cd PS && psexec -accepteula -i -d -s "sc delete WLMS"'
Start-Process -FilePath "cmd.exe" -Verb RunAs -ArgumentList '/c c: && cd / && cd PS && psexec -accepteula -i -s "REG DELETE HKLM\SYSTEM\CurrentControlSet\Services\WLMS /va /f"'
@cookpoo78

Copy link
Copy Markdown

Doesn't work :(

@Marshall-Hallenbeck

Copy link
Copy Markdown
Author

Doesn't work :(

In what way? Still shuts down? This is a bit old so maybe they updated it.

@cookpoo78

Copy link
Copy Markdown

Yep, still shuts down. thanks!

@Marshall-Hallenbeck

Copy link
Copy Markdown
Author

Yep, still shuts down. thanks!

Darn okay, I'll update the title of this so people don't get their hopes up. It worked at one point, I'll have to look into it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment