标题: [系统相关] 求助批处理schtasks 批量删除 关键词任务 [打印本页]
作者: qq8899399 时间: 2024-8-19 14:34 标题: 求助批处理schtasks 批量删除 关键词任务
G:\Downtemp\edge>schtasks /query /fo csv |findstr /I MicrosoftEdge
"\MicrosoftEdgeUpdateBrowserReplacementTask","N/A","就绪"
"\MicrosoftEdgeUpdateTaskMachineCore{6FB29BF6-EB3C-4326-AD82-701E4AA30538}","2024/8/19 14:43:42","就绪"
"\MicrosoftEdgeUpdateTaskMachineCore{6FB29BF6-EB3C-4326-AD82-701E4AA30538}","2024/8/19 14:43:42","就绪"
"\MicrosoftEdgeUpdateTaskMachineUA{35251314-FA8F-43D9-AA53-1F684058C880}","2024/8/19 15:13:42","就绪"
因为SID不一样。所以。 请问。批处理如何写 能先从schtasks /query结果 里找到MicrosoftEdgeUpdate里相关的任务删除
作者: qq8899399 时间: 2024-8-19 14:42
PS的话。是
Get-ScheduledTask -taskname MicrosoftEdgeUpdate* | Unregister-ScheduledTask -Confirmfalse
但想用批处理实现这一功能
作者: ygqiang 时间: 2024-8-19 16:00
- @echo off & setlocal enabledelayedexpansion
- echo 代码开始
-
- @echo off &for /f "tokens=1* delims=: " %%a in (
- ' schtasks /query /fo list^|findstr /irc:".*Windows Defender*.*" ') do (echo,schtasks /delete /tn "%%b" /f)
- @echo off &for /f "tokens=1* delims=: " %%a in (
- ' schtasks /query /fo list^|findstr /irc:".*MicrosoftEdge*.*" ') do (echo,schtasks /delete /tn "%%b" /f)
- @echo off &for /f "tokens=1* delims=: " %%a in (
- ' schtasks /query /fo list^|findstr /irc:".*Wps*.*" ') do (echo,schtasks /delete /tn "%%b" /f)
- pause
-
- @echo off &for /f "tokens=1* delims=: " %%a in (
- ' schtasks /query /fo list^|findstr /irc:".*Windows Defender*.*" ') do (schtasks /delete /tn "%%b" /f)
- @echo off &for /f "tokens=1* delims=: " %%a in (
- ' schtasks /query /fo list^|findstr /irc:".*MicrosoftEdge*.*" ') do (schtasks /delete /tn "%%b" /f)
- @echo off &for /f "tokens=1* delims=: " %%a in (
- ' schtasks /query /fo list^|findstr /irc:".*Wps*.*" ') do (schtasks /delete /tn "%%b" /f)
- pause
复制代码
作者: qq8899399 时间: 2024-8-19 16:28
回复 3# ygqiang
感谢~
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |