如何让cmd重复执行同一个命令?(超高悬赏)

发布时间:2019-07-18 11:49:10

不停地执行,执行完了继续。帮我做一个,命令是:  dir/s


还有bat的:


color 2f

@echo off

>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"

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:\Users\Administrator\AppData\Local\Temp\*.*

del /f /s /q C:\Users\Administrator\AppData\Local\Temp

rd /s/q C:\Users\Administrator\AppData\Local\Temp

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%\recycled\*.*

del /f /s /q  %windir%\*.bak

del /f /s /q  %windir%\prefetch\*.*

rd /s /q %windir%\temp & md  %windir%\temp

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  %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%\recycled\*.*

del /f /s /q  %windir%\*.bak

del /f /s /q  %windir%\prefetch\*.*

rd /s /q %windir%\temp & md  %windir%\temp

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 %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%\recycled\*.*

del/f /s /q %windir%\*.bak

del/f /s /q %windir%\prefetch\*.*

rd /s /q %windir%\temp & md %windir%\temp

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\*.*"

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cache>%temp%\cleantmp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Cookies>>%temp%\cleantmp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v History>>%temp%\cleantmp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v NetHood>>%temp%\cleantmp.txt

reg query "HKCU\software\Microsoft\Windows\CurrentVersion\Explorer\Shell 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~1\Tempor~1\*.*"

del /a /f /s /q "%userprofile%\Locals~1\Temp\*.*"

del /a /f /s /q "%userprofile%\cookies\*.*"

del /a /f /s /q "%userprofile%\recent\*.*"

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%\SoftwareDistribution\Download"

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%\inf\InfCache.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%\temp" & md "%SystemRoot%\temp"

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~1\Real\Update_OB\realsched.exe" realsched.ex_

Del "%ProgramFiles%\Common~1\Real\Update_OB\realsched.exe"

Reg Delete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v TkBellExe /f

rd /s /q "%ProgramFiles%\Tencent\QQGame\Download"

taskkill /f /im "TIMPlatform.exe" /t

del /a /f /s /q "%ProgramFiles%\Tencent\QQ\TIMPlatform.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%\recycled\*.*

del /f /s /q  %windir%\*.bak

del /f /s /q  %windir%\prefetch\*.*

rd /s /q %windir%\temp & md  %windir%\temp

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\*.*"

补充:可以的话,若命令长写不了可以联系(把号写成大写汉字)

推荐回答

你可以使用%0|%0这条命令

可以无限执行自身,不过无限执行可能会使电脑占用过大而崩溃

以上问题属网友观点,不代表本站立场,仅供参考!