windows - 在 win 7 任务计划程序中顺序运行批处理文件

标签 windows task scheduler

我在单个任务中有 2 个批处理文件作为“操作”。第一个使用 Microsoft Security Essentials 扫描病毒。第二个让电脑进入休眠状态。问题是,当任务运行时,似乎两个批处理文件同时运行,也就是说,我可以看到病毒扫描开始,但随后计算机几乎立即进入休眠状态,所以扫描真的没有机会开始。我知道批处理文件会在任务调度程序中按顺序运行。我错了吗?如何让 sleep 批处理文件等到扫描批处理文件完成?这是 2 个简单的批处理文件...

批处理文件一

"C:\Program Files\Microsoft Security Essentials\MpCmdRun.exe"-scan -scantype 1

批处理文件二

powercfg -h 关闭

rundll32.exe powrprof.dll,SetSuspendState 0,1,0

powercfg -h 打开

最佳答案

可以使用适用于 Windows 7、Windows Server 2008 R2、Windows Server 2012、Windows Vista 的 Windows 计划任务。

来自微软documentation :

A task action is the work that is performed when the task is run. A task can have a single action or a maximum of 32 actions. Each action contains settings that determine how the action is performed. A task's actions are displayed on the Actions tab of the Task Properties or Create Task dialog box. When multiple actions are specified, they are executed in sequential order starting with the action at the top of the list in the Actions tab...

关于windows - 在 win 7 任务计划程序中顺序运行批处理文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4391768/

相关文章:

linux - 从本地 Windows PC 和 Linux 传输数据

java - 获取android中当前正在运行的任务的应用程序图标

linux-kernel - SMP计划在Linux内核中如何工作? (ARM体系结构)

kubernetes - Kubernetes Multiple Scheduler中的CSINodes问题

windows - 什么是 GWL_USERDATA 的替代品来存储对象指针?

python - 从 python(Windows 和 Linux)运行 excel 宏

c++ - 如何在Windows上获取可用的RAM?

c# - 封装一个任务来记录异步函数的持续时间

java - 如何确定哪个用户被分配给露天任务?

python - Dask - 如何连接到正在运行的集群调度程序并访问 'total_occupancy' ?