REG Delete用法

使用regdelete命令

reg delete 从注册表删除项或子项

  语法:reg delete KeyName [{/v EntryName|/ve|/va}] [/f]   参数   KeyName   指定子项的完全路径。对于远程计算机,请在\ComputerName\PathToSubkey中的子项路径前包含计算机名称。忽略ComputerName会导致默认对本地计算机进行操作。以相应的子目录树开始路径。有效子目录树为HKLM、HKCU、HKCR、HKU以及HKCC。   /v EntryName   删除子项下的特定项。如果未指定项,则将删除子项下的所有项和子项。   /ve   指定只可以删除为空值的项。   /va   删除指定子项下的所有项。使用本参数不能删除指定子项下的子项。   /f   无需请求确认而删除现有的注册表子项或项。   /?   在命令提示符显示帮助。

转载于:https://blog.51cto.com/brave8898/2074528

自己编写的很强悍的删除系统垃圾批处理工具: @echo off color 02 echo ::清理局域网共享痕迹--注册表:: reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\WorkgroupCrawler\Shares" /f >nul 2>nul echo ::用户运行或操作历史记录--注册表:: reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\Folder" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.txt" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.rar" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.mp3" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.jpg" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.ini" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.bmp" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.doc" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.eip" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.htm" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.ico" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.inf" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.gif" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.wav" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.xls" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs\.rm" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RecentDocs" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\LastVisitedMRU" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\*" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\mp3" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\rm" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\wav" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\bat" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\exe" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\eip" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\ico" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\htm" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32\OpenSaveMRU\jpg" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StreamMRU" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{5E6AB780-7743-11CF-A12B-00AA004AE837}\Count" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\UserAssist\{75048700-EF1F-11D0-9888-006097DEACF9}\Count" /va /f >nul 2>nul reg delete "HKCU\Software\WinRAR\ArcHistory" /va /f >nul 2>nul reg delete "HKCU\Software\WinRAR\DialogEditHistory\ArcName" /va /f >nul 2>nul reg delete "HKCU\Software\WinRAR\DialogEditHistory\ExtrPath" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\MediaPlayer\Player\RecentFileList" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Microsoft Management Console\Recent File List" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Office\11.0\PowerPoint\Recent File List" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Office\11.0\Excel\Recent File" /va /f >nul 2>nul reg delete "HKCU\Software\Microsoft\Office\11.0\Word\Data" /v "Settings" /f >nul 2>nul reg delete "HKCU\Software\VMware, Inc." /va /f >nul 2>nul echo ::清理IE浏览历史的下拉列表--注册表:: reg delete "HKCU\Software\Microsoft\Internet Explorer\TypedUrls" /va /f >nul 2>nul echo ::清理系统垃圾文件:: del /f /q "%ALLUSERSPROFILE%\Documents\DrWatson\*.*">nul 2>nul del /f /q "%USERPROFILE%\Application Data\Microsoft\Office\Recent\*.lnk">nul 2>nul del /f /s /q %systemdrive%\*.tmp del /f /s /q %systemdrive%\*._mp del /f /s /q %systemdrive%\*.log del /f /s /q %systemdrive%\*.gid del /f /s /q %systemdrive%\*.chk del /f /s /q %systemdrive%\*.old del /f /s /q %USERPROFILE%\Local Settings\Temp\*.* del /f /s /q %systemdrive%\recycled\*.* del /f /s /q %windir%\*.bak del /f /q %userprofile%\cookies\*.* del /f /q %userprofile%\recent\*.* del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*" del /f /s /q "%userprofile%\Local Settings\Temp\*.*" del /f /s /q "%userprofile%\recent\*.*" del /f /s /q %windir%\system32\dllcache\*.* DEL /F /s /q %windir%\temp\*.* del /f /s /q %windir%\prefetch\*.* del /f /s /q %windir%\*.log echo sfc /purgecache '清理系统盘无用文件 echo defrag %systemdrive% -b '优化预读信息 exit 将以上代码存为.bat文件即可。 建议大家手动删一下这些目录下的垃圾文件: C:\WINDOWS\system32\dllcache C:\WINDOWS\Prefetch C:\WINDOWS\Temp C:\Documents and Settings\%userfile%\Cookies C:\Documents and Settings\Administrator\Local Settings\Temp C:\Documents and Settings\Administrator\Local Settings\Temporary Internet Files C:\Documents and Settings\Administrator\Recent 还有windows目录下所有蓝色的以$符号开头结尾的系统更新垃圾! 当然,你要开启查看隐藏文件才行,
@echo off :: 禁用右键授予访问权限 reg delete “HKEY_CLASSES_ROOT*\shellex\ContextMenuHandlers\Sharing” /f >nul 2>&1 reg delete “HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers\Sharing” /f >nul 2>&1 reg delete “HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\Sharing” /f >nul 2>&1 reg delete “HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers\Sharing” /f >nul 2>&1 reg delete “HKEY_CLASSES_ROOT\LibraryFolder\background\shellex\ContextMenuHandlers\Sharing” /f >nul 2>&1 :: 禁用还原到以前版本 reg delete “HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\PropertySheetHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\CLSID{450D8FBA-AD25-11D0-98A8-0800361B1103}\shellex\ContextMenuHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\CLSID{450D8FBA-AD25-11D0-98A8-0800361B1103}\shellex\PropertySheetHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\Directory\shellex\PropertySheetHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\Directory\shellex\ContextMenuHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\Drive\shellex\ContextMenuHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f reg delete “HKEY_CLASSES_ROOT\Drive\shellex\PropertySheetHandlers{596AB062-B4D2-4215-9F74-E9109B0A8153}” /f :: 禁用所有文件/文件夹的发送到菜单 reg delete “HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers\SendTo” /f :: 禁用右键的共享 reg delete “HKEY_LOCAL_MACHINE\SOFTWARE\Classes*\shellex\ContextMenuHandlers\ModernSharing” /f reg delete “HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AllFilesystemObjects\shellex-ContextMenuHandlers\ModernSharing” /f :: 添加哈希校验菜单 reg add “HKEY_CLASSES_ROOT*\shell\文件哈希校验” /v “SubCommands” /t REG_SZ /d “MD5;SHA1;SHA256;SHA384;SHA512;MACTripleDES;RIPEMD160” /f reg add “HKEY_CLASSES_ROOT*\shell\文件哈希校验” /v “MUIVerb” /t REG_SZ /d “文件哈希校验” /f for %%a in (MACTripleDES MD5 RIPEMD160 SHA1 SHA256 SHA384 SHA512) do ( reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell%%a” /ve /d “%%a” /f reg add “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell%%a\command” /ve /d “PowerShell Get-FileHash -Algorithm %%a "%%1" | format-list;"按任意键退出…";[Console]::Readkey() | Out-Null;exit” /f ) :: 禁用按5次shift粘连提示 reg add “HKEY_CURRENT_USER\Control Panel\Accessibility\StickyKeys” /v “Flags” /t REG_SZ /d “26” /f :: 关闭自动更新离线地图 reg add “HKEY_LOCAL_MACHINE\SYSTEM\Maps” /v “AutoUpdateEnabled” /t REG_DWORD /d 0 /f :: 刷新桌面 taskkill /f /im explorer.exe start explorer.exe 优化一下这个代码,增加显示哪些已经设置完毕之类的
03-14
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值