Resource icon

Guide Windows 10 Strip Down Script 2018-09-25

No permission to download
This is a Powershell script that I run on all my Windows 10 mining rigs when first provisioning them. What this script does is help strip down Windows 10 and get rid of a lot of the unneeded extra fluff that isn't required for mining. There are also some tweaks included not related to mining which you may either opt to use if you choose.

If there are certain things you would like to retain/leave the default, just add # at the beginning of the line to make the script ignore it or delete the line of code. Any line with a # at the start will be ignored and can also be used for comments/notes.

I will attach the Powershell script as a download but also include it directly in this post to attempt to break down the script so that anyone interested can understand a bit more what is going on.

I stumbled upon this in 2016 on the Ethereum Mining Forums and have made changes from the original. I am not 100% sure who the original author is so I do not take credit for providing this.

Note: Before running the script you must do the following or it will give you an error.
  1. Click the Windows icon on the bottom left of your Desktop
  2. Type cmd
  3. Right click on Command Prompt and run as Administrator
  4. Type or copy-paste the following without quotes "powershell Set-ExecutionPolicy RemoteSigned" and press enter.
  5. There will be no confirmation, but it you put you at the next line.
  6. Either type exit and press enter or close the Command Prompt.
------------------------------------------------------------------------------
  1. Download attached file to Desktop
    (Next 3 steps are optional)
    1. Right click on the file and click edit
    2. Go here and find your time zone
    3. On line 100 change the text in quotes to your time zone, save, and exit.
      Screenshot_89.png
  2. Click the Windows icon on the bottom left of your Desktop
  3. Type powershell
  4. Right Click and run as Administrator
  5. A prompt should pop up showing C:\Windows\system32
  6. Type or copy-paste the following without quotes "cd C:\Users\*insert your account name*\Desktop" and press enter.
  7. Type .\stripwin10.ps1 and press enter. The Powershell script should start to run.
  8. Note that it is normal for it to show errors if certain Windows Store Apps are not found because this originally was from a few years ago.

# Don't append "- Shortcut" to new shortcuts
New-Item -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ -Name NamingTemplates -Force
New-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates -Name "ShortcutNameTemplate" -PropertyType "String" -Value '%s.lnk'

# Show filename extensions and hidden files in windows explorer
$key = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced'
Set-ItemProperty $key Hidden 1
Set-ItemProperty $key HideFileExt 0
Stop-Process -processname explorer

# Set windows page file to 32GB (If running multiple higher end GPUs you may need to increase this to the amount of total VRAM your GPUs have)
$SystemInfo=Get-WmiObject -Class Win32_ComputerSystem -EnableAllPrivileges
$SystemInfo.AutomaticManagedPageFile = $false
$PageFile = Get-WmiObject -Class Win32_PageFileSetting -Filter "SettingID='pagefile.sys @ C:'"
Set-WmiInstance -Class Win32_PageFileSetting -Arguments @{name="C:\pagefile.sys"; InitialSize = 32768; MaximumSize = 32768} ` -EnableAllPrivileges |Out-Null

# Disable hibernate
Start-Process 'powercfg.exe' -Verb runAs -ArgumentList '/h off'

# Disable standby/sleep
powercfg -change -standby-timeout-ac 0

# Set commonly recommended environment variables to be able to utilize your GPUs to the max
setx GPU_FORCE_64BIT_PTR 0
setx GPU_MAX_HEAP_SIZE 100
setx GPU_USE_SYNC_OBJECTS 1
setx GPU_SINGLE_ALLOC_PERCENT 100
setx GPU_MAX_ALLOC_PERCENT 100

# The next line will remove ALL windows apps and most likely break Windows Store. I will leave a # to ignore it since there are certain applications that are handy such as Calculator and Sticky Notes
#Get-AppxPackage | Remove-AppxPackage

# Remove specific Windows Store Apps
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage
Get-AppxPackage *windowsmaps* | Remove-AppxPackage
Get-AppxPackage *solitairecollection* | Remove-AppxPackage
Get-AppxPackage *bingfinance* | Remove-AppxPackage
Get-AppxPackage *zunevideo* | Remove-AppxPackage
Get-AppxPackage *bingnews* | Remove-AppxPackage
Get-AppxPackage *onenote* | Remove-AppxPackage
Get-AppxPackage *people* | Remove-AppxPackage
Get-AppxPackage *windowsphone* | Remove-AppxPackage
Get-AppxPackage *photos* | Remove-AppxPackage
Get-AppxPackage *windowsstore* | Remove-AppxPackage
Get-AppxPackage *bingsports* | Remove-AppxPackage
Get-AppxPackage *soundrecorder* | Remove-AppxPackage
Get-AppxPackage *bingweather* | Remove-AppxPackage
Get-AppxPackage *xboxapp* | Remove-AppxPackage
Get-AppxPackage *FarmVille2CountryEscape* | Remove-AppxPackage
Get-AppxPackage *Microsoft.XboxIdentityProvider* | Remove-AppxPackage
Get-AppxPackage *king.com.CandyCrushSodaSaga* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Advertising.Xaml* | Remove-AppxPackage
Get-AppxPackage *Microsoft.WindowsFeedbackHub* | Remove-AppxPackage
Get-AppxPackage *Microsoft.StorePurchaseApp* | Remove-AppxPackage
Get-AppxPackage *Microsoft.Messaging* | Remove-AppxPackage
Get-AppxPackage *PandoraMediaInc* | Remove-AppxPackage
Get-AppxPackage *Drawboard.DrawboardPDF* | Remove-AppxPackage
Get-AppxPackage *Twitter* | Remove-AppxPackage
Get-AppxPackage *Candy* | Remove-AppxPackage
Get-AppxPackage *FarmVille* | Remove-AppxPackage
Get-AppxPackage *One* | Remove-AppxPackage

# Stop and remove OneDrive
write-host Stopping OneDrive
taskkill /f /im OneDrive.exe
timeout /t 3 /nobreak

write-host Uninstalling OneDrive
& $env:SystemRoot\SysWOW64\OneDriveSetup.exe /uninstall
timeout /t 3 /nobreak

write-host Removing OneDrive from the Explorer Side Panel
REG DELETE "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f
REG DELETE "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /f

# Remove HomeGroup from Windows Explorer and stop associated services
Set-Service HomeGroupProvider -StartupType Disabled
Stop-Service HomeGroupProvider

# Set network connection to private to allow visibility of other Computers/File Shares on your LAN
Set-NetConnectionProfile -NetworkCategory Private

# Change your computer name (If you want to easily distinguish your different mining rigs, choose a worker/rig name and replace the text in the next line. You will be able to use the variable %computername% in a batch file for your miner)
$name = Read-Host -Prompt 'Change this to your worker or rig name'
Rename-Computer -NewName $name

# Enable remote desktop access
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0
Enable-NetFirewallRule -DisplayGroup "Remote Desktop"
set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1

# Change time zone (Replace text between quotes on the next line with your time zone)
tzutil.exe /s "Eastern Standard Time"

# Disable device driver updates
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\ -Name WindowsUpdate -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name "ExcludeWUDriversInQualityUpdate" -PropertyType "DWord" -Value '1'

# Disable Windows Update Reboots
New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate -Name AU -Force
New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU -Name "NoAutoRebootWithLoggedOnUsers" -PropertyType "DWord" -Value '1'

# Disable superfetch
Set-Service SysMain -StartupType Disabled
Stop-Service SysMain

# Uncomment the next line if you want to disable Windows Defender
# Set-MpPreference -DisableRealtimeMonitoring $true

$enter = read-host "Many of the changes made require a reboot, press enter to close this window and restart your computer."
Sources
https://forum.ethereum.org/discussion/10859/powershell-script-to-quickly-setup-a-win10-environment
Author
noobasaur
Downloads
15
First release
Last update
Rating
0.00 star(s) 0 ratings
Top Bottom