Skip to content

Instantly share code, notes, and snippets.

@wincmd64
Last active March 23, 2024 14:10
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wincmd64/48beae60fb20043a8d60d105e301e8db to your computer and use it in GitHub Desktop.
Save wincmd64/48beae60fb20043a8d60d105e301e8db to your computer and use it in GitHub Desktop.
:: Windows 10\11 quick setup
:: The encoding of this file must be OEM 866
:: https://t.me/wincmd64
@echo off
NET SESSION
IF %ERRORLEVEL% NEQ 0 GOTO ELEVATE
GOTO ADMINTASKS
:ELEVATE
cls
echo MUST BE RUN AS ADMIN !
pause
exit
:ADMINTASKS
cls
:: check win ver
>nul 2>&1 (copy /l nul nul && cmd.exe /e:on /c for /f "delims=[ tokens=2" %%A in ('ver'^) do for /f "tokens=2,3 delims=. " %%B in ("%%A"^) do if 10 gtr %%B if %%B==6 if 4 gtr %%C call) && echo RUN SCRIPT ? && echo. || color 4 && echo The detected system is older than Windows 10. && echo STILL RUN THE SCRIPT ? && echo.
pause
@echo on
:: ========== COMMON ==========
:: Отключает гибернацию и удаляет файл C:\hiberfil.sys
powercfg -h off
:: Панель управления > Электропитание. Схема питания "Высокая производительность"
powercfg /S 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
:: Не отключать жесткий диск | https://www.tenforums.com/tutorials/21454-turn-off-hard-disk-after-idle-windows-10-a.html
powercfg -change -disk-timeout-ac 0
:: Панель управления. Крупные значки
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel" /v StartupPage /t REG_DWORD /d 1 /f
:: Панель управления > Звуки. OFF "Проигрывать мелодию запуска Windows"
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\BootAnimation" /v DisableStartupSound /t REG_DWORD /d 1 /f
:: Проводник. Всегда показывать расширения файлов
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f
:: Проводник. Отключить префикс " - ярлык" при создании новых ярлыков
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\NamingTemplates" /v ShortcutNameTemplate /d \"%%s.lnk\" /f
:: Панель задач. Увеличить скорость открытия миниатюр
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ExtendedUIHoverTime /t REG_DWORD /d 100 /f
:: Панель задач. Переходить на последнее открытое окно при клике по сгруппированным приложениям
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LastActiveClick /t REG_DWORD /d 1 /f
:: ...или вовсе не группировать (для 7 и 10)
:: reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarGlomLevel /t REG_DWORD /d 2 /f
:: Определяет положение переключателей в окне Быстродействие (SystemPropertiesPerformance.exe)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects" /v VisualFXSetting /t REG_DWORD /d 3 /f
reg add "HKCU\Control Panel\Desktop" /v UserPreferencesMask /t REG_BINARY /d 9032078010000000 /f
reg add "HKCU\Control Panel\Desktop\WindowMetrics" /v MinAnimate /d 0 /f
:: Отключает блокировку скачанных файлов. https://habr.com/ru/post/505194/
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v SaveZoneInformation /t REG_DWORD /d 1 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v SaveZoneInformation /t REG_DWORD /d 1 /f
:: Файлы как текстовые
assoc .=txtfile
assoc .wer=txtfile
:: Добавляет в shift+меню всех файлов пункт "Открыть в Блокноте"
reg add "HKCR\*\shell\Открыть в Блокноте" /v "Icon" /d "%%systemroot%%\System32\notepad.exe" /f
reg add "HKCR\*\shell\Открыть в Блокноте" /v "Extended" /f
reg add "HKCR\*\shell\Открыть в Блокноте\command" /ve /d "notepad.exe %%1" /f
:: ========== LOCAL NETWORK ==========
netsh advfirewall firewall set rule group="Обнаружение сети" new enable=Yes
:: RDP
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
netsh advfirewall firewall set rule group="Дистанционное управление рабочим столом" new enable=Yes
:: ========== WORKGROUP ==========
:: net user Гость /active:yes
:: netsh advfirewall firewall set rule group="Общий доступ к файлам и принтерам" new enable=Yes
:: netsh advfirewall firewall set rule group="Инструментарий управления Windows (wmi)" new enable=yes
:: win10+
:: reg add "HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v AllowInsecureGuestAuth /t REG_DWORD /d 1 /f
:: Отключает Master Browser (win10+). Альтернативный вариант -- https://habr.com/ru/articles/680896
:: reg add "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Parameters" /v IsDomainMaster /d FALSE /f
:: reg add "HKLM\SYSTEM\CurrentControlSet\Services\Browser\Parameters" /v MaintainServerList /d NO /f
:: Ошибка 0x0000011b при подключении к принтеру
:: reg add "HKLM\System\CurrentControlSet\Control\Print" /v RpcAuthnLevelPrivacyEnabled /t REG_DWORD /d 0 /f
:: Ошибка 0x00000bcb при подключении к принтеру
:: reg add "HKLM\Software\Policies\Microsoft\Windows NT\Printers\PointAndPrint" /v RestrictDriverInstallationToAdministrators /t REG_DWORD /d 0 /f
:: access admin share with UAC enabled
::reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system" /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f
:: Часовой пояс UTC+02:00
tzutil /s "FLE Standard Time"
:: Английский как метод ввода по-умолчанию (UA: 0422:00000422 RU: 0419:00000419)
powershell Set-WinDefaultInputMethodOverride -InputTip "0409:00000409"
:: Убирает задержку автозапуска
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /v StartupDelayInMSec /t REG_DWORD /d 0 /f
:: ON журнал буфера обмена (по Win+V) в Система > Буфер обмена
reg add "HKCU\Software\Microsoft\Clipboard" /v EnableClipboardHistory /t REG_DWORD /d 1 /f
:: OFF "Автоматическое скрытие полос прокрутки" в Спец.возможности
reg add "HKCU\Control Panel\Accessibility" /v DynamicScrollbars /t REG_DWORD /d 0 /f
:: Проводник. Иконка "Этот компьютер" на рабочем столе
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" /v {20D04FE0-3AEA-1069-A2D8-08002B30309D} /t REG_DWORD /d 0 /f
:: Проводник. "Этот компьютер" вместо "Быстрый доступ" при запуске по умолчанию
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v LaunchTo /t REG_DWORD /d 1 /f
:: Добавляем ярлыки в Быстрый доступ проводника
powershell "(New-Object -ComObject Shell.Application).Namespace('shell:appdata').Self.InvokeVerb('pintohome')"
powershell "(New-Object -ComObject Shell.Application).Namespace('shell:Local AppData\temp').Self.InvokeVerb('pintohome')"
powershell "(New-Object -ComObject Shell.Application).Namespace('shell:startup').Self.InvokeVerb('pintohome')"
:: Панель задач. Убирает кнопки поиска и задач
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Search" /v SearchboxTaskbarMode /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowTaskViewButton /t REG_DWORD /d 0 /f
:: Пуск. Отключить поиск в Интернете
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f
:: ON "Заголовки и границы окон" в Персонализация > Цвета
reg add "HKCU\Software\Microsoft\Windows\DWM" /v ColorPrevalence /t REG_DWORD /d 1 /f
:: OFF "Продолжить способы завершения настройки устройства" в Система > Уведомления. Это предотвратит появление навязчивого окна, которое появляется через какое-то время после установки
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\UserProfileEngagement" /v ScoobeSystemSettingEnabled /t REG_DWORD /d 0 /f
:: Схема курсоров "По умолчанию (крупный)"
reg add "HKCU\Control Panel\Cursors" /ve /d "По умолчанию (крупный)" /f
reg add "HKCU\Control Panel\Cursors" /v "AppStarting" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_working_l.ani" /f
reg add "HKCU\Control Panel\Cursors" /v "Arrow" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_arrow_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "Hand" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_link_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "Help" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_helpsel_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "No" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_unavail_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "NWPen" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_pen_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "SizeAll" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_move_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "SizeNESW" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_nesw_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "SizeNS" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_ns_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "SizeNWSE" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_nwse_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "SizeWE" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_ew_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "UpArrow" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_up_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "Wait" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_busy_l.ani" /f
reg add "HKCU\Control Panel\Cursors" /v "Pin" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_pin_l.cur" /f
reg add "HKCU\Control Panel\Cursors" /v "Person" /t REG_EXPAND_SZ /d "%%SystemRoot%%\cursors\aero_person_l.cur" /f
:: UAC без заморозки (предпоследнее положение ползунка)
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v PromptOnSecureDesktop /t REG_DWORD /d 0 /f
:: Отключить автозапуск Edge | https://admx.help/?Category=EdgeChromium&Policy=Microsoft.Policies.Edge::StartupBoostEnabled
reg add "HKLM\SOFTWARE\Policies\Microsoft\Edge" /v StartupBoostEnabled /t REG_DWORD /d 0 /f
:: Телеметрия -- https://admx.help/?Category=Windows_11_2022&Policy=Microsoft.Policies.DataCollection::AllowTelemetry
reg add "HKLM\Software\Policies\Microsoft\Windows\DataCollection" /v "AllowTelemetry" /t REG_DWORD /d 0 /f
:: Отключает службу "Функциональные возможности для подключенных пользователей и телеметрия"
sc stop "DiagTrack" && sc config "DiagTrack" start=disabled
:: Отображать FPS в GameBar
net localgroup "Пользователи журналов производительности" "Все" /add
:: Отключает задания в планировщике
schtasks /Change /DISABLE /TN "\Microsoft\Windows\Defrag\ScheduledDefrag"
schtasks /Change /DISABLE /TN "\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser"
schtasks /Change /DISABLE /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTask"
schtasks /Change /DISABLE /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskLogon"
schtasks /Change /DISABLE /TN "\Microsoft\Windows\SoftwareProtectionPlatform\SvcRestartTaskNetwork"
:: OFF "Последние действия и результаты сканирования" в Windows Defender
reg add "HKLM\SOFTWARE\Microsoft\Windows Defender Security Center\Virus and threat protection" /v SummaryNotificationDisabled /t REG_DWORD /d 1 /f
:: ...или вовсе отключить (применять, ТОЛЬКО если понимаете последствия!) win10
:: reg add "HKLM\software\policies\microsoft\windows defender" /v DisableAntiSpyware /t REG_DWORD /d 1 /f
:: check win ver
@echo off
for /f "tokens=2 delims==" %%a in ('wmic os get Caption /value ^| findstr /C:"Caption"') do set os=%%a
echo %os% | findstr /C:"Windows 10" > nul && goto 10
echo %os% | findstr /C:"Windows 11" > nul && goto 11
:10
echo.
echo ===== %os% =====
@echo on
:: OFF "Прикрепить Окна" в Система > Многозадачность
reg add "HKCU\Control Panel\Desktop" /v WindowArrangementActive /d 0 /f
:: Панель задач. Убирает кнопку новостей
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Feeds" /v EnableFeeds /t REG_DWORD /d 0 /f
:: ON "Уменьшить время задержки и увеличить производительность" в Система > Дисплей > Настройки графики
reg add "HKLM\SYSTEM\CurrentControlSet\Control\GraphicsDrivers" /v HwSchMode /t REG_DWORD /d 2 /f
goto install
:11
echo.
echo ===== %os% =====
@echo on
:: Классическое контекстное меню
reg add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /f /ve
:: OFF "Показывать макеты прикрепления при перетаскивании окна" в Система > Многозадачность
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v EnableSnapBar /t REG_DWORD /d 0 /f
:: ON "Оптимизация для игр в оконном режиме" в Система > Дисплей > Графика
reg add "HKCU\Software\Microsoft\DirectX\UserGpuPreferences" /v DirectXUserGlobalSettings /d "SwapEffectUpgradeEnable=1;" /f
:: OFF "Print screen" в Спец.возможности
reg add "HKCU\Control Panel\Keyboard" /v PrintScreenKeyForSnippingEnabled /t REG_DWORD /d 0 /f
:: Панель задач. Убирает виджеты и выравнивает кнопку Пуск
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarDa /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f
:: Teams (22H2)
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarMn /t REG_DWORD /d 0 /f
:: Проводник. Компактное представление
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v UseCompactMode /t REG_DWORD /d 1 /f
goto install
:install
@echo off
echo.
echo Install Hyper-V, Sandbox and VCRedist ?
pause
@echo on
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
DISM /Online /Enable-Feature /All /FeatureName:Containers-DisposableClientVM
winget install --id=Microsoft.VCRedist.2015+.x64 -e
pause
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment