Skip to content

Instantly share code, notes, and snippets.

@gregmac
Last active September 27, 2021 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregmac/741d594b5739c91689078df13ffa2fc6 to your computer and use it in GitHub Desktop.
Save gregmac/741d594b5739c91689078df13ffa2fc6 to your computer and use it in GitHub Desktop.
Windows 10 Setup

Install:

  • Powershell 7
  • Windows Terminal
  • Rename computer: Rename-Computer -NewName "Server044" -Restart
  • Scoop
    • scoop install sudo
  • Run Reclaim windows 10 script
  • More Scoop apps:
scoop install git
scoop bucket add extras
scoop bucket add nirsoft
scoop bucket add nerd-fonts

scoop install greenshot
scoop install winaero-tweaker
scoop install notepadplusplus
regsvr32 /i NppShell_01.dll
# Alternative to: regsvr32 /i NppShell_01.dll
$npp = "$(scoop prefix notepadplusplus)\notepad++.exe"
function New-ItemIfNotExists($path,$name) { if (!(Test-Path -Path "$path\$name")) { New-Item -Path $path -Name $name -Force } }
New-ItemIfNotExists "HKCU:\Software\Classes\*\shell\Open with &Notepad++"
Set-ItemProperty -Path "HKCU:\Software\Classes\*\shell\Open with &Notepad++" -Name "Icon" -Value "$npp"
New-ItemIfNotExists "HKCU:\Software\Classes\*\shell\Open with &Notepad++\command"
Set-Item -Path "HKCU:\Software\Classes\*\shell\Open with &Notepad++\command" -Value "`"$npp`" `"%1`""
New-ItemIfNotExists "HKCU:\Software\Classes\Directory\shell\Open with &Notepad++"
Set-ItemProperty -Path "HKCU:\Software\Classes\Directory\shell\Open with &Notepad++" -Name "Icon" -Value "$npp"
New-ItemIfNotExists "HKCU:\Software\Classes\Directory\shell\Open with &Notepad++\command"
Set-Item -Path "HKCU:\Software\Classes\Directory\shell\Open with &Notepad++\command" -Value "`"$npp`" `"%1`""
New-ItemIfNotExists "HKCU:\Software\Classes\Directory\Background\shell\Open with &Notepad++"
Set-ItemProperty -Path "HKCU:\Software\Classes\Directory\Background\shell\Open with &Notepad++" -Name "Icon" -Value "$npp"
New-ItemIfNotExists "HKCU:\Software\Classes\Directory\Background\shell\Open with &Notepad++\command"
Set-Item -Path "HKCU:\Software\Classes\Directory\Background\shell\Open with &Notepad++\command" -Value "`"$npp`" `"%V`""
# Extract of [Reclaim windows 10 script](https://gist.github.com/gregmac/c8cf9fe7e48d0e9a15c985674b9861d9) to quickly setup a current user settings of a system
Write-Host "Disabling Lock screen spotlight..."
#Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "RotatingLockScreenOverlayEnabled" -Type DWord -Value 0
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SubscribedContent-338387Enabled" -Type DWord -Value 0
Write-Host "Showing titles in taskbar..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "MMTaskbarGlomLevel" -Type DWord -Value 1
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "MMTaskbarMode" -Type DWord -Value 1
Write-Host "Showing hidden files..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1
Write-Host "Changing default Explorer view to This PC..."
Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
Write-Host "Hiding Videos icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue
Write-Host "Hiding 3D Objects icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}" -Recurse -ErrorAction SilentlyContinue
Write-Host "Hiding Music icon from This PC..."
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue
Remove-Item -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue
Write-Host "Removing secondary keyboards..."
$langs = Get-WinUserLanguageList
Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -eq "en-US"}) -Force
Write-Host "Setting ISO date format..."
Set-ItemProperty -Path "HKCU:\Control Panel\International" -Name "sShortDate" -Type String -Value "yyyy-MM-dd"
Write-Host "Show seconds in clock..."
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowSecondsInSystemClock" -Type DWord -Value 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment