如何让cmd重复执行同一个命令?(超高悬赏)
不停地执行,执行完了继续。帮我做一个,命令是: dir/s
还有bat的:
color 2f
@echo off
>nul 2>&1 "%SYSTEMROOT%system32cacls.exe" "%SYSTEMROOT%system32configsystem"
if '%errorlevel%' NEQ '0' (
echo 请求管理员权限...
goto UACPrompt
) else ( goto gotAdmin )
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%getadmin.vbs"
"%temp%getadmin.vbs"
exit /B
:gotAdmin
chkdsk
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q C:UsersAdministratorAppDataLocalTemp*.*
del /f /s /q C:UsersAdministratorAppDataLocalTemp
rd /s/q C:UsersAdministratorAppDataLocalTemp
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 %systemdrive% ecycled*.*
del /f /s /q %windir%*.bak
del /f /s /q %windir%prefetch*.*
rd /s /q %windir% emp & md %windir% emp
del /f /q %userprofile%cookies*.*
del /f /q %userprofile% ecent*.*
del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
del /f /s /q "%userprofile%Local SettingsTemp*.*"
del /f /s /q "%userprofile% ecent*.*"
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 %systemdrive% ecycled*.*
del /f /s /q %windir%*.bak
del /f /s /q %windir%prefetch*.*
rd /s /q %windir% emp & md %windir% emp
del /f /q %userprofile%cookies*.*
del /f /q %userprofile% ecent*.*
del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
del /f /s /q "%userprofile%Local SettingsTemp*.*"
del /f /s /q "%userprofile% ecent*.*"
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 %systemdrive% ecycled*.*
del/f /s /q %windir%*.bak
del/f /s /q %windir%prefetch*.*
rd /s /q %windir% emp & md %windir% emp
del/f /q %userprofile%cookies*.*
del/f /q %userprofile% ecent*.*
del/f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
del/f /s /q "%userprofile%Local SettingsTemp*.*"
del/f /s /q "%userprofile% ecent*.*"
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v Cache>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v Cookies>>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v History>>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v NetHood>>%temp%cleantmp.txt
reg query "HKCUsoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders" /v Recent>>%temp%cleantmp.txt
for /f "tokens=3*" %%a in (%temp%cleantmp.txt) do (
for /d %%i in ("%%a %%b*.*") do rd /s /q "%%i"
del /a /f /s /q "%%a %%b*.*"
)
del /a /f /s /q "%userprofile%Locals~1Tempor~1*.*"
del /a /f /s /q "%userprofile%Locals~1Temp*.*"
del /a /f /s /q "%userprofile%cookies*.*"
del /a /f /s /q "%userprofile% ecent*.*"
del /a /f /s /q "%Temp%*.*"
del /a /f /s /q "%Tmp%*.*"
del /a /f /s /q "%HomePath%..IconCache.db"
del /a /f /s /q "%SystemRoot%*._mp"
del /a /f /s /q "%SystemRoot%*.bak"
del /a /f /s /q "%SystemRoot%*.dmp"
del /a /f /s /q "%SystemRoot%*.gid"
del /a /f /s /q "%SystemRoot%*.old"
del /a /f /s /q "%SystemRoot%*.query"
del /a /f /q "%SystemRoot%*.tmp"
rd /s /q "%SystemRoot%Downloaded Program Files"
rd /s /q "%SystemRoot%Offline Web Pages"
rd /s /q "%systemroot%Connection Wizard"
rd /s /q "%SystemRoot%SoftwareDistributionDownload"
rd /s /q "%SystemRoot%Assembly"
rd /s /q "%SystemRoot%Help"
rd /s /q "%SystemRoot%ReinstallBackups"
del /a /s /q "%SystemRoot%inf*.pnf"
del /a /f /s /q "%SystemRoot%infInfCache.1"
dir %SystemRoot%inf*.* /ad/b >%SystemRoot%vTmp.txt
for /f %%a in (%SystemRoot%vTmp.txt) do rd /s /q "%SystemRoot%inf%%a"
del /a /f /s /q "%SystemRoot%driver?*.pnf"
del /a /f /s /q "%SystemRoot%driver?InfCache.1"
del /a /f /s /q "%SystemDrive%driver?*.pnf"
del /a /f /s /q "%SystemDrive%driver?InfCache.1"
rd /s /q "%SystemRoot% emp" & md "%SystemRoot% emp"
del /a /f /s /q "%SystemRoot%Prefetch*.*"
del /a /f /s /q "%SystemRoot%minidump*.*"
del /a /f /q "%SystemDrive%*.chk"
dir %SystemDrive%found.??? /ad/b >%SystemRoot%vTmp.txt
for /f %%a in (%SystemRoot%vTmp.txt) do rd /s /q "%SystemDrive%%%a"
dir %SystemRoot%$*$ /ad/b >%SystemRoot%vTmp.txt
for /f %%a in (%SystemRoot%vTmp.txt) do rd /s /q "%SystemRoot%%%a"
rd /s /q "%ProgramFiles%InstallShield Installation Information"
Ren "%ProgramFiles%Common~1RealUpdate_OB ealsched.exe" realsched.ex_
Del "%ProgramFiles%Common~1RealUpdate_OB ealsched.exe"
Reg Delete "HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun" /v TkBellExe /f
rd /s /q "%ProgramFiles%TencentqqGameDownload"
taskkill /f /im "TIMPlatform.exe" /t
del /a /f /s /q "%ProgramFiles%TencentqqTIMPlatform.exe"
del /a /f /s /q "%ProgramFiles%Kaspersky Lab*.tmp"
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 %systemdrive% ecycled*.*
del /f /s /q %windir%*.bak
del /f /s /q %windir%prefetch*.*
rd /s /q %windir% emp & md %windir% emp
del /f /q %userprofile%cookies*.*
del /f /q %userprofile% ecent*.*
del /f /s /q "%userprofile%Local SettingsTemporary Internet Files*.*"
del /f /s /q "%userprofile%Local SettingsTemp*.*"
del /f /s /q "%userprofile% ecent*.*"
你可以使用%0|%0这条命令
可以无限执行自身,不过无限执行可能会使电脑占用过大而崩溃
下一篇:电脑配置价钱