Skip to content

Instantly share code, notes, and snippets.

@eddieparker
Last active April 19, 2021 17:37
Show Gist options
  • Save eddieparker/a1fc4c96e87638fb3ca7 to your computer and use it in GitHub Desktop.
Save eddieparker/a1fc4c96e87638fb3ca7 to your computer and use it in GitHub Desktop.
bootstrap new windows machine
@echo off
goto check_Permissions
:check_Permissions
echo Administrative permissions required. Detecting permissions...
net session >nul 2>&1
if %errorLevel% == 0 (
echo Success: Administrative permissions confirmed; continuing.
) else (
echo Failure: Current permissions inadequate.
exit /b
)
echo Sort the dir cmd output in a sensical way
setx DIRCMD /ognes
echo Have keepass create a sock file to aid in sshing
setx SSH_AUTH_SOCK c:\tmp\keepass.sock
echo Install chocolatey
powershell -Command "& {Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))}"
echo Install apps
"C:\ProgramData\chocolatey\bin\choco.exe" install -y megasync brave authy-desktop autohotkey anonymouspro clink docker-for-windows ctags lockhunter windirstat less steam open-shell
echo Enable remote desktop
powershell -Command "& {Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -name "fDenyTSConnections" -value 0}"
echo Fix up janky windows explorer defaults
powershell -Command "& {Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' Hidden 1}"
powershell -Command "& {Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' HideFileExt 0}"
powershell -Command "& {Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' ShowSuperHidden 1}"
powershell -Command "& {Stop-Process -processname explorer}"
REM TODO: Default cmd vs powershell for WIN+X?
REM TODO: Switch from windows explorer default to "view this PC" vs "quick whatever"?
REM TODO: Unpin default task bar items and hide search/cortana/etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment