From 9e91cb5022903ff09e5140e25d634a81ef316572 Mon Sep 17 00:00:00 2001 From: Johan Date: Sun, 28 Apr 2024 17:13:25 +0200 Subject: [PATCH] Add Windows-Tweaks.bat --- Node.JS.md | 3 ++ Windows/PostInstall/Windows-Tweaks.bat | 73 ++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 Windows/PostInstall/Windows-Tweaks.bat diff --git a/Node.JS.md b/Node.JS.md index 55a5d80..de469ec 100644 --- a/Node.JS.md +++ b/Node.JS.md @@ -13,6 +13,9 @@ Efter installation, avsluta aktuell SSH session och logga in igen. ## [Installera Node.JS versionsväljare under Windows](https://github.com/coreybutler/nvm-windows/releases "NVM for Windows")
nvm install 16.13 && nvm use 16.13
+Installera senaste LTS version + +
nvm install lts
## Uppdatera moduler diff --git a/Windows/PostInstall/Windows-Tweaks.bat b/Windows/PostInstall/Windows-Tweaks.bat new file mode 100644 index 0000000..87fa62e --- /dev/null +++ b/Windows/PostInstall/Windows-Tweaks.bat @@ -0,0 +1,73 @@ +@echo off +net session >nul 2>&1 || ( + powershell -c "start cmd -ArgumentList '/c call """%~f0""" %*' -verb runas" >nul 2>&1 || echo This script needs administrative privileges + exit /b +) + +pushd %~d0%~p0 + +echo Show Explorer file extensions. +REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /F >nul 2>&1 +echo Show hidden files. +REG ADD HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v Hidden /t REG_DWORD /d 1 /F >nul 2>&1 + +echo Adding context menu Command prompt here and Powershell here +REG ADD HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd /v "MUIVerb" /d "Command Prompts" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd /v "Icon" /d "cmd.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\01MenuCmd /v "ExtendedSubCommandsKey" /d "Directory\ContextMenus\MenuCmd" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\01MenuCmd /v "MUIVerb" /d "Command Prompts" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\01MenuCmd /v "Icon" /d "cmd.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\01MenuCmd /v "ExtendedSubCommandsKey" /d "Directory\ContextMenus\MenuCmd" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open /v "MUIVerb" /d "Command Prompt" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open /v "Icon" /d "cmd.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\open\command /d "cmd.exe /s /k pushd ""%%V""" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas /v "MUIVerb" /d "Command Prompt Elevated" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas /v "Icon" /d "cmd.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas /v "HasLUAShield" /d "" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuCmd\shell\runas\command /d "cmd.exe /s /k pushd ""%%V""" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell /v "MUIVerb" /d "PowerShell Prompts" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell /v "Icon" /d "powershell.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\02MenuPowerShell /v "ExtendedSubCommandsKey" /d "Directory\ContextMenus\MenuPowerShell" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\02MenuPowerShell /v "MUIVerb" /d "PowerShell Prompts" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\02MenuPowerShell /v "Icon" /d "powershell.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\02MenuPowerShell /v "ExtendedSubCommandsKey" /d "Directory\ContextMenus\MenuPowerShell" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open /v "MUIVerb" /d "PowerShell" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open /v "Icon" /d "powershell.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\open\command /d "powershell.exe -noexit -command Set-Location ""%%V""" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas /v "MUIVerb" /d "PowerShell Elevated" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas /v "Icon" /d "powershell.exe" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas /v "HasLUAShield" /d "" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\ContextMenus\MenuPowerShell\shell\runas\command /d "powershell.exe -noexit -command Set-Location ""%%V""" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\cmd /v "Extended" /d "" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\cmd /v "Extended" /d "" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\shell\Powershell /v "Extended" /d "" /F >nul 2>&1 +REG ADD HKEY_CLASSES_ROOT\Directory\background\shell\Powershell /v "Extended" /d "" /F >nul 2>&1 + +echo Disabling password complexity. +@rem secedit /export /cfg "%cd%\secconfig.cfg" +( + echo [Unicode] + echo Unicode=yes + echo [System Access] + echo MinimumPasswordAge = 0 + echo MaximumPasswordAge = -1 + echo MinimumPasswordLength = 0 + echo PasswordComplexity = 0 + echo PasswordHistorySize = 0 + echo LockoutBadCount = 0 + echo RequireLogonToChangePassword = 0 + echo ForceLogoffWhenHourExpire = 0 + echo ClearTextPassword = 0 + echo LSAAnonymousNameLookup = 0 + echo EnableAdminAccount = 1 + echo EnableGuestAccount = 0 + echo [Version] + echo signature="$CHICAGO$" + echo Revision=1 +)>"secconfig.cfg" +secedit /configure /db "%windir%\security\local.sdb" /cfg "%cd%\secconfig.cfg" >nul +del secconfig.cfg + +echo. +echo All done! +popd