V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
qinwangzeng
V2EX  ›  Windows

windows 脚本,俄神精简系统放桌面的,有大佬来解读一下吗

  •  
  •   qinwangzeng · 2021-10-25 13:27:15 +08:00 · 3125 次点击
    这是一个创建于 1159 天前的主题,其中的信息可能已经有所发展或是发生改变。
    @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
    

    运行完系统就不会更新了 不小心非管理员运行了一遍

    8 条回复    2021-10-26 08:41:06 +08:00
    qW7bo2FbzbC0
        1
    qW7bo2FbzbC0  
       2021-10-25 13:29:07 +08:00
    注释不是都写了吗?
    PrinceofInj
        2
    PrinceofInj  
       2021-10-25 13:36:02 +08:00 via Android
    Windows 优化大师重出江湖
    Vindroid
        3
    Vindroid  
       2021-10-25 13:40:31 +08:00
    那么长串,正好重装系统做 win11 吧
    yuchenr
        4
    yuchenr  
       2021-10-25 14:05:00 +08:00
    注释写的很清楚,最上面的是 删除启动项,禁用 BITS 和更新服务、还原经典的图片查看器等等
    scyuns
        5
    scyuns  
       2021-10-25 14:06:55 +08:00
    上面注释不是写得很清楚吗?看了一下 都是常规的 操作!
    Karonheaven
        6
    Karonheaven  
       2021-10-25 14:17:18 +08:00
    DISM++,请
    一项一项的比命令行好懂多了
    https://www.chuyu.me/en/index.html
    ysc3839
        7
    ysc3839  
       2021-10-25 19:05:40 +08:00
    powercfg /h off 禁用休眠
    后两行 删除所有启动项
    后一行 禁用 UAC
    后两行 禁用两个服务
    后两行不知道
    bcdedit /set {current} bootmenupolicy legacy 使用 Win7 传统风格的引导菜单
    后面几行 把图片文件关联设置成 PhotoViewer
    后面一堆 rd 是删除任务计划
    再后面都有注释了
    最后一个是添加一个一次性启动项 删除 defaultuser0 的文件
    l4ever
        8
    l4ever  
       2021-10-26 08:41:06 +08:00
    powercfg /h off
    这怎么行, 别运行别人的优化.
    出问题都不知道出在哪里.
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2559 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 04:51 · PVG 12:51 · LAX 20:51 · JFK 23:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.