将下面这段代码复制到记事本里,另存到
C:\WINDOWS\System32\GroupPolicy\Machine\Scripts\Shutdown\
文件类型选所有文件,名字随便起,后缀是.vbs
然后运行粗庆gpedit.msc,计算机配置,Windows设置,脚本(启动/关机)。双击右边的“关机”,点添加,把刚才的脚本添加进去就可以了,想实现更多功能,直接修改脚本。
set fs=wscript.createObject("wscript.shell")
fs.run "cmd.exe /c del /f /s /q %systemdrive%\*.tmp",0,true
fs.run "cmd.exe /c del /f /s /q %systemdrive%\*._mp ",0,true
fs.run "cmd.exe /c del /f /s /q %systemdrive%\*.log ",0,true
fs.run "cmd.exe /c del /f /s /q %systemdrive%\*.gid ",0,true
fs.run "cmd.exe /c del /f /s /q %systemdrive%\*.chk ",0,true
fs.run "cmd.exe /c del /f /s /q %systemdrive%\*.old ",0,true
fs.run "cmd.exe /c del /f /s /q %systemdrive%\recycled\*.* ",0,true
fs.run "cmd.exe /做凳稿c del /f /s /q %windir%\*.bak ",0,true
fs.run "cmd.exe /c del /f /s /q %windir%\纯孝prefetch\*.* ",0,true
fs.run "cmd.exe /c rd /s /q %windir%\temp &md %windir%\temp ",0,true
fs.run "cmd.exe /c del /f /q %userprofile%\cookies\*.* ",0,true
fs.run "cmd.exe /c del /f /q %userprofile%\recent\*.* ",0,true
fs.run "cmd.exe /c del /f /s /q ¨%userprofile%\Local Settings\Temporary Internet Files\*.*〃 ",0,true
fs.run "cmd.exe /c del /f /s /q ¨%userprofile%\Local Settings\Temp\*.*〃 ",0,true
fs.run "cmd.exe /c del /f /s /q ¨%userprofile%\recent\*.*〃 ",0,true
wscript.echo "清除系统垃圾完成"
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)