Win10系统精简bat脚本 Restart.cmd,来自俄罗斯Russian lopatkin的精简Win10系统。
系统安装完成后会自动运行这个精简脚本。
然后文件会自己删除自己。
下面是文件内容:
REM 开始
@Echo off
color 1f
powercfg /h off
REG DELETE HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f /reg:64
REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f /reg:64
REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v "EnableLUA" /t REG_DWORD /d "00000000" /f
REG ADD "HKLM\SYSTEM\CurrentControlSet\services\BITS" /v "Start" /t REG_DWORD /d "00000004" /f /reg:64
REG ADD "HKLM\SYSTEM\CurrentControlSet\services\wuauserv" /v "Start" /t REG_DWORD /d "00000004" /f /reg:64
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager" /v "BackupCount" /t REG_DWORD /d "00000002" /f /reg:64
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Configuration Manager\LastKnownGood" /v "Enabled" /t REG_DWORD /d "00000001" /f /reg:64
bcdedit /set {current} bootmenupolicy legacy
cls
REG ADD "HKCR\.bmp" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
REG ADD "HKCR\.gif" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
REG ADD "HKCR\.ico" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
REG ADD "HKCR\.jpeg" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
REG ADD "HKCR\.jpg" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
REG ADD "HKCR\.png" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
REG ADD "HKCR\.tiff" /v "" /t REG_SZ /d "PhotoViewer.FileAssoc.Tiff" /f
cls
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\.NET Framework"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Active Directory Rights Management Services Client"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\AppID"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Application Experience"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\ApplicationData"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\AppxDeploymentClient"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Autochk"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\BitLocker"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Bluetooth"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\BrokerInfrastructure"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\CertificateServicesClient"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Chkdsk"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Clip"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\CloudExperienceHost"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Customer Experience Improvement Program"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Data Integrity Scan"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Defrag"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Device Setup"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Device Information"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\DeviceDirectoryClient"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Diagnosis"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\DiskCleanup"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\DiskDiagnostic"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\DiskFootprint"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\DUSM"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\EDP"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\EnterpriseMgmt"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\ErrorDetails"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Feedback"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\File Classification Infrastructure"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\FileHistory"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\LanguageComponentsInstaller"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\License Manager"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Live"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Location"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Maps"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Offline Files"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\SettingSync"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Maintenance"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Management"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\MemoryDiagnostic"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Mobile Broadband Accounts"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\NlaSvc"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\PI"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\PLA"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\RecoveryEnvironment"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Registry"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\RemoteApp and Desktop Connections Update"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\RemoteAssistance"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\RetailDemo"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Servicing"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Setup"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\SharedPC"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\SpacePort"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Speech"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Storage Tiers Management"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Subscription"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\SyncCenter"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Sysmain"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\SystemRestore"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\TaskScheduler"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Time Synchronization"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Time Zone"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\TPM"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\UpdateOrchestrator"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WCM"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WDI"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Windows Activation Technologies"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WindowsBackup"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Windows Defender"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Windows Error Reporting"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Windows Media Sharing"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WindowsUpdate"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WOF"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Work Folders"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Workplace Join"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WS"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WwanSvc"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\XblGameSave"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\ExploitGuard"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Printing"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\UNP"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\WaaSMedic"
rd /S /Q "%SystemRoot%\System32\Tasks\Microsoft\Windows\Windows Subsystem For Linux"
cls
REM -- Disables Aero Shake
reg add "HKCU\Software\Policies\Microsoft\Windows\Explorer" /v NoWindowMinimizingShortcuts /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Policies\Microsoft\Windows\Explorer" /v NoWindowMinimizingShortcuts /t REG_DWORD /d 1 /f
REM -- Disables Notifications in File Explorer in Windows 10
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSyncProviderNotifications /t REG_DWORD /d 0 /f
REM -- Disables automatic driver downloads from Windows Update
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\DriverSearching" /v "SearchOrderConfig" /t REG_DWORD /d 2 /f
REM -- Shows file extensions
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f
REM -- Sets default view for explorer to "This PC"
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "LaunchTo" /t REG_DWORD /d 1 /f
REM -- Hides Task View Button
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "ShowTaskViewButton" /t REG_DWORD /d 0 /f
REM -- Disables security warnings
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Associations" /v "DefaultFileTypeRisk" /t REG_DWORD /d 1808 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Attachments" /v "SaveZoneInformation" /t REG_DWORD /d 1 /f
REM -- Sets timeout for the System to end processes/services after the user tries to shutdown
reg add "HKCU\Control Panel\Desktop" /v "WaitToKillAppTimeout" /t REG_SZ /d "10000" /f
reg add "HKLM\System\CurrentControlSet\Control" /v "WaitToKillServiceTimeout" /t REG_SZ /d "10000" /f
REM -- Improves responsiveness of your system by removing delays
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Serialize" /v "StartupDelayInMSec" /t REG_DWORD /d 75 /f
reg add "HKCU\Control Panel\Desktop" /v "MenuShowDelay" /t REG_DWORD /d 75 /f
reg add "HKCU\Control Panel\Mouse" /v "MouseHoverTime" /t REG_SZ /d 75 /f
REM -- Disables automatic maintenance
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Schedule\Maintenance" /v "MaintenanceDisabled" /t REG_DWORD /d "1" /f
REM -- Disables Encrypting File System
reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "NtfsDisableEncryption" /t REG_DWORD /d 1 /f
reg add "HKLM\System\CurrentControlSet\Control\FileSystem" /v "NtfsDisableLastAccessUpdate" /t REG_DWORD /d 1 /f
REM -- Disables Wifi Sense
reg add "HKLM\Software\Microsoft\WcmSvc\wifinetworkmanager\config" /v AutoConnectAllowedOEM /t REG_DWORD /d 0 /f
reg add "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" /v "value" /t REG_DWORD /d 0 /f
reg add "HKLM\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" /v "value" /t REG_DWORD /d 0 /f
REM -- Disables sending files to encrypted drives
reg add "HKLM\Software\Policies\Microsoft\Windows\EnhancedStorageDevices" /v "TCGSecurityActivationDisabled" /t REG_DWORD /d 0 /f
REM -- Disables OneDrive Sync
reg add "HKLM\Software\Policies\Microsoft\Windows\OneDrive" /v "DisableFileSyncNGSC" /t REG_DWORD /d 1 /f
REM -- Disables settings synchronization
reg add "HKLM\Software\Policies\Microsoft\Windows\SettingSync" /v "DisableSettingSync" /t REG_DWORD /d 2 /f
reg add "HKLM\Software\Policies\Microsoft\Windows\SettingSync" /v "DisableSettingSyncUserOverride" /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\WINEVT\Channels\Microsoft-Windows-Application-Experience/Steps-Recorder" /v "Enabled" /t REG_DWORD /d 0 /f
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /v "DownloadMode" /t REG_DWORD /d 0 /f
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" /v "DODownloadMode" /t REG_DWORD /d 0 /f
REM -- Increases wallpaper image quality
reg add "HKCU\Control Panel\Desktop" /v "JPEGImportQuality" /t REG_DWORD /d 100 /f
REM -- Disables automatic update for downloaded maps
reg add "HKLM\Software\Policies\Microsoft\Windows\Maps" /v "AutoDownloadAndUpdateMapData" /t "REG_DWORD" /d 0 /f
REM -- Removes OneDrive from autorun and explorer
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "OneDrive" /f > NUL 2>&1
reg add "HKEY_CLASSES_ROOT\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0 /f
reg add "HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" /v "System.IsPinnedToNameSpaceTree" /t REG_DWORD /d 0 /f > NUL 2>&1
REM -- Removes frequent/recent entries from explorer
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowFrequent" /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer" /v "ShowRecent" /t REG_DWORD /d 0 /f
REM -- Disables CD/DVD/USB autorun
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutorun" /t REG_DWORD /d "0xFF" /f
reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v "NoDriveTypeAutorun" /t REG_DWORD /d "0xFF" /f
REM -- Sets computers active hours to 10-22h
reg add "HKLM\Software\Microsoft\WindowsUpdate\UX\Settings" /v "ActiveHoursStart" /t REG_DWORD /d "10" /f
reg add "HKLM\Software\Microsoft\WindowsUpdate\UX\Settings" /v "ActiveHoursEnd" /t REG_DWORD /d "22" /f
REM -- Removes "Scan with Windows defender" from context menu (only works if WD is disabled)
reg delete "HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\EPP" /f > NUL 2>&1
reg delete "HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\EPP" /f > NUL 2>&1
reg delete "HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\EPP" /f > NUL 2>&1
REM -- Internet Explorer / Microsoft Edge optimizations
reg add "HKLM\Software\Policies\Microsoft\Internet Explorer\Suggested Sites" /v Enabled /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Policies\Microsoft\Internet Explorer" /v AllowServicePoweredQSA /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Policies\Microsoft\Windows\CurrentVersion\Explorer\AutoComplete" /v AutoSuggest /t REG_SZ /d no /f
reg add "HKLM\Software\Policies\Microsoft\Internet Explorer\Infodelivery\Restrictions" /v NoUpdateCheck /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Policies\Microsoft\Internet Explorer\Geolocation" /v PolicyDisableGeolocation /t REG_DWORD /d 1 /f
reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\Main" /v "Use FormSuggest" /t REG_SZ /d no /f
reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\Main" /v DoNotTrack /t REG_DWORD /d 0 /f
reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\Main" /v "FormSuggest Passwords" /t REG_SZ /d no /f
reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\SearchScopes" /v ShowSearchSuggestionsGlobal /t REG_DWORD /d 0 /f
reg add "HKLM\Software\Policies\Microsoft\MicrosoftEdge\PhishingFilter" /v EnabledV9 /t REG_DWORD /d 0 /f
REM -- Prevent device metadata retrieval from the Internet
reg add "HKLM\Software\Policies\Microsoft\Windows\Device Metadata" /v PreventDeviceMetadataFromNetwork /t REG_DWORD /d 1 /f
REM -- Disable Windows Updates for Malicious Software Removal Tool
reg add "HKLM\Software\Policies\Microsoft\MRT" /v DontOfferThroughWUAU /t REG_DWORD /d 1 /f
REM -- Disables Aero Peek
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v DisablePreviewDesktop /t REG_DWORD /d 1 /f
cls
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /v "setup_cleanup1" /d "%comspec% /c rd /s /q %SystemDrive%\Users\defaultuser0\"
shutdown.exe /r /f /t 10 /c "Restart"
del /F /Q %0
exit
REM 结束