101 lines
5.8 KiB
Batchfile
101 lines
5.8 KiB
Batchfile
@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 Enabling numlock during login screen
|
|
reg add "HKEY_USERS\.DEFAULT\Control Panel\Keyboard" /v InitialKeyboardIndicators /t REG_SZ /d 2 /f
|
|
echo Enabling numlock when logged in
|
|
reg add "HKEY_CURRENT_USER\Control Panel\Keyboard" /v InitialKeyboardIndicators /t REG_SZ /d 2 /f
|
|
|
|
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
|
|
|
|
choice /C yn /M "Switch to classic context menus?"
|
|
if %ERRORLEVEL% EQU 1 (
|
|
echo Switching to classic context menus.
|
|
REG ADD HKEY_CURRENT_USER\SOFTWARE\CLASSES\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32 /F >nul 2>&1
|
|
taskkill /F /IM explorer.exe & start explorer
|
|
)
|
|
|
|
choice /C yn /M "Disable UAC?"
|
|
if %ERRORLEVEL% EQU 1 (
|
|
echo Disabling UAC.
|
|
REG ADD HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\system /v EnableLUA /t REG_DWORD /d 0 /F >nul 2>&1
|
|
echo You must restart the computer before changes are in effect.
|
|
)
|
|
|
|
choice /C yn /M "Disable adds?"
|
|
if %ERRORLEVEL% EQU 1 (
|
|
echo Disabling adds
|
|
reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v Start_IrisRecommendations /t REG_DWORD /d 0 /f >nul 2>&1
|
|
echo Disabling Copilot
|
|
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsCopilot" /v TurnOffWindowsCopilot /t REG_DWORD /d 1 /f >nul 2>&1
|
|
)
|
|
|
|
echo.
|
|
echo All done!
|
|
popd
|