Win11专业版21H2
华为桌面云
Win11如何用批处理一键禁用所有任务计划
1.新建批处理文件
批处理文件内容:
@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%
pause
2.以管理员身份运行,即可