取的计划任务信息 [英] Fetch info of scheduled tasks
问题描述
我在前面张贴了这个问题:
检查真实路径或工作内容/任务
I earlier posted this question: Check real path or content of job/task
这可能是一个有点混乱,所以我改述:我想要的是内容,名称,描述系统上的任务等。
This may have been a bit confusing, so I'm rephrasing: what I want is the content, name, description etc. of a task on the system.
例如,我想知道哪些任务包含或执行IEXPLORE.EXE。
For example, I want to know which tasks contain or execute iexplore.exe.
我用下面的命令:
schtasks /query /fo LIST /v | findstr /i /s "iexplore.exe"
这会给我的输出:
任务运行:C:\\ Program Files文件\\的Internet Explorer \\ IEXPLORE.EXE
Task to Run: C:\Program Files\Internet Explorer\iexplore.exe
但是,这是信息不足。理想情况下,我想列出:
名称,位置,说明
But this is insufficient information. Ideally, I want to have listed: Name, Location, Description
如果我使用:
schtasks /query /v | findstr /i /s "iexplore.exe"
我收到了一大堆输出,未排序的,而不是所有相关的(我不想知道电池模式等)
I get a whole bunch of output, unsorted and not all relevant (I don't want to know the battery mode etc.)
有没有办法来完成我想要的输出(例如:)
Is there a way to accomplish the output I'd like (for example:)
任务运行:C:\\ Program Files文件\\的Internet Explorer \\ IEXPLORE.EXE
Task to run: C:\Program Files\Internet Explorer\iexplore.exe
名称:管理
说明:打开管理界面
位置:%USERPROFILE%\\桌面\\ Management.html
Location: %userprofile%\desktop\Management.html
通过的schtasks这是可能的呢?如果没有的话,我可以使用 DIR 命令不知何故,以列表格式或至少干净的输出如上?
Is this possible at all via schtasks? And if not, can I use the dir command somehow, in a list format or at least clean output as above?
我想输出被输送到一个日志文件或文本文件(因为我有一些脚本,我可以把它放在那里)。
I would like the output to be piped into a log or text file (as I have some scripts, I can just put it in there).
感谢您!
推荐答案
EDITED 现在它处理的每一次出现IEXPLORE.EXE
EDITED now it handles every occurence of "iexplore.exe"
@echo off
setlocal enabledelayedexpansion
set "task="
for /f "tokens=2 delims=," %%a in ('schtasks /query /fo csv /v ^| find /i "iexplore.exe"') do (
set "task=%%~a"
schtasks /query /fo list /v /tn "!task!"|findstr /c:"Aufgabenname" /c:"Kommentar" /c:"Starten in" /c:"Auszufhrende Aufgabe"
)
注:该名称是依赖于Windows安装的语言。大部分的审核规定都不在我的Windows存在,所以我用我的本地名称。请使其适应您的需求。
NOTE: The names are dependent on the language of the windows installation. Most of your criterias don't exist on my windows, so I used my local names. Please adapt them to your needs.
这篇关于取的计划任务信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!