|
本帖最后由 wu733 于 2024-1-7 23:02 编辑
虽然看不懂,还是要硬着头皮学习
也附上论坛里面不知哪个大佬的黑科技代码:
::禁用非必要的任务计划
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YY=%dt:~2,2%" & set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" & set "Sec=%dt:~12,2%"
set "fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
set "logfile=%systemdrive%\Windows\Temp\tweak_taskscheduler_%fullstamp%.log"
set /A r=0
for /f "tokens=2 delims=," %%f in ('schtasks /query /v /fo csv /nh') do (
set /A r=0
set ff=%%f
for %%i in (
"\Microsoft\Windows\TextServicesFramework\MsCtfMonitor"
) do (
if %%i==%%f (
echo skip: %%f>>%logfile%
set /A r=1
)
)
if !r!==0 (
echo try disable: %%f>>%logfile%
schtasks /change /disable /TN %%f >>%logfile% 2>&1
)
)
|
|