Skip to content

Instantly share code, notes, and snippets.

@TheCaptain989
Created July 28, 2019 17:38
Show Gist options
  • Save TheCaptain989/22ddc5327b5965b052e71a4da686c5fb to your computer and use it in GitHub Desktop.
Save TheCaptain989/22ddc5327b5965b052e71a4da686c5fb to your computer and use it in GitHub Desktop.
Remove Windows 10 junk and unwanted services from a new install
# Change your computer name
$name = Read-Host -Prompt 'Enter new workstation name'
Rename-Computer -NewName $name
# 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
# 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 # generated an error
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 *cortana* | Remove-AppxPackage # generated an error
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
Get-AppxPackage *Microsoft.NetworkSpeedTest* | Remove-AppxPackage
Get-AppxPackage *office.sway* | Remove-AppxPackage
Get-AppxPackage *xbox* | Remove-AppxPackage
Get-AppxPackage *netflix* | Remove-AppxPackage
Get-AppxPackage *stickynotes* | Remove-AppxPackage
Get-AppxPackage *print3d* | Remove-AppxPackage
Get-AppxPackage *3dviewer* | Remove-AppxPackage
Get-AppxPackage *mixedreality* | Remove-AppxPackage
Get-AppxPackage *wallet* | Remove-AppxPackage
# Remove provisioned apps
Get-AppXProvisionedPackage -Online | Remove-AppxProvisionedPackage -Online
# 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
# 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 "Central 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
# Remove Wallpaper
Set-ItemProperty -path "HKCU:Control Panel\Desktop" -Name WallPaper -value ""
RUNDLL32.EXE USER32.DLL,UpdatePerUserSystemParameters ,1 ,True
# Uncomment the next line if you want to disable Windows Defender
# Set-MpPreference -DisableRealtimeMonitoring $true
# Disable Cortana
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\" -Name "Windows Search" -Force
New-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search" -Name "AllowCortana" -PropertyType "DWord" -Value '0'
# Disable Internet Explorer
Get-WindowsCapability -Online | ? {$_.Name -like "*InternetExplorer*"} | Remove-WindowsCapability -Online
#Get-WindowsOptionalFeature -Online | ? {$_.FeatureName -eq 'Internet-Explroer-Optional-amd64'} | Disable-WindowsOptiona
# Remove other features
Get-WindowsCapability -Online | ? {$_.Name -like "*Hello.Face*" -and $_.State -eq 'Installed'} | Remove-WindowsCapability -Online
Get-WindowsCapability -Online | ? {$_.Name -like "*Handwriting*" -and $_.State -eq 'Installed'} | Remove-WindowsCapability -Online
#Get-WindowsCapability -Online | ? {$_.Name -like "*Speech*" -and $_.State -eq 'Installed'} | Remove-WindowsCapability -Online
$enter = read-host "Many of the changes made require a reboot, press enter to close this window and restart your computer."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment