一键垃圾清理(cmd)

admin2021-05-10  2.2K+

import process.popen;
import console;


var cmds={'@echo off';
'echo 正在清除系统垃圾文件,请稍等……';
'del /f /s /q %systemdrive%\\*.tmp';
'del /f /s /q %systemdrive%\\*._mp';
'del /f /s /q %systemdrive%\\*.gid';
'del /f /s /q %systemdrive%\\*.chk';
'del /f /s /q %systemdrive%\\*.old';
'del /f /s /q %systemdrive%\\*.xlk';
'del /f /s /q %systemdrive%\\*.log';
'del /f /s /q %windir%\\*.bak';
'del /f /s /q %systemdrive%\\recycled\\*.*';
'del /f /s /q %windir%\\temp\\*.*';
'del /f /s /q %windir%\\prefetch\\*.*';
'del /f /a /q %systemdrive%\\*.sqm';
'del /f /s /q %windir%\\SoftwareDistribution\\Download\\*.*';
'del /f /s /q "%userprofile%\\cookies\\*.*"';
'del /f /s /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%\\AppData\\Local\\temp\\*.*"';
'del /f /s /q "%userprofile%\\AppData\\Local\\Microsoft\\Windows\\Caches\\*.*"';
'del /f /s /q "%userprofile%\\AppData\\Local\\Microsoft\\Windows\\INetCache\\*.*"';
'echo 清除系统垃圾文件完成!';
'echo. & pause'}
for(i=1;#cmds;1){
	var p = process.popen.cmd(cmds[i])
	for(ok,out,err in p.each()){
		console.log(out);
		console.log(err);
		//console.log(out,err);/*读取进程输出直到进程关闭*/
		//mainForm.edit.text += out +'\r\n';
	}	

}


console.pause();
转载请注明原文地址: https://aardio.net/read-182.html
最新回复(1)
  • snzyj2021-5-27
    引用2
    import process.batch
    import console;

    io.open()
    var startCmd=`
    @echo off
    echo 正在清除系统垃圾文件,请稍等……
    del /f /s /q %systemdrive%*.tmp
    del /f /s /q %systemdrive%*._mp
    del /f /s /q %systemdrive%*.gid
    del /f /s /q %systemdrive%*.chk
    del /f /s /q %systemdrive%*.old
    del /f /s /q %systemdrive%*.xlk
    del /f /s /q %systemdrive%*.log
    del /f /s /q %windir%*.bak
    del /f /s /q %systemdrive%recycled*.*
    del /f /s /q %windir%temp*.*
    del /f /s /q %windir%prefetch*.*
    del /f /a /q %systemdrive%*.sqm
    del /f /s /q %windir%SoftwareDistributionDownload*.*
    del /f /s /q "%userprofile%cookies*.*"
    del /f /s /q "%userprofile%recent\*.*"
    del /f /s /q "%userprofile%local settingstemporary internet files*.*"
    del /f /s /q "%userprofile%local settingstemp*.*"
    del /f /s /q "%userprofile%AppDataLocaltemp*.*"
    del /f /s /q "%userprofile%AppDataLocalMicrosoftWindowsCaches*.*"

    del /f /s /q "%userprofile%AppDataLocalMicrosoftWindowsINetCache*.*"
    echo 清除系统垃圾文件完成!
    `
    process.batch(startCmd)
    process.batch(startCmd).logResponse()
    console.pause();
源码分享
aardio源码分享