|
::【禁用所有计划任务(禁用不是删除文件,不会蓝屏,放心使用)】【windows7 上测试通过(其它版本未知)】
@echo off & setlocal EnableDelayedExpansion
set "cmdhead=schtasks /change /disable /tn "
set "filelist=%TMP%\filelist.txt"
set "filebat=%TMP%\myschtasks.bat"
set "dir_tasks=C:\Windows\System32\Tasks"
dir /a-d /b /s %dir_tasks% > %filelist%
echo @echo off > %filebat%
set j=0
for /f "delims=" %%i in (%filelist%) do (
set /a j+=1
set line!j!=%%i
call set a=%%line!j!%%
echo %cmdhead%"!a:~25!" >> %filebat%
)
call %filebat%
del /q /f %filelist%
del /q /f %filebat%
exit
|
|