.bat将窗口移到前面

时间:2018-08-24 17:28:02

标签: batch-file scheduled-tasks workflow taskscheduler

我有一个.bat脚本,该脚本可以打开程序并在单击时运行worflow,但是,当我使用Windows任务计划程序时,它将无法运行。

是否有一些代码可以将窗口移到最前面来激活“ ^ r”功能?我不确定为什么单击时可以正常运行,但不能按计划运行。

谢谢

此处脚本:::::

@if (@CodeSection == @Batch) @then


@echo off

rem Use %SendKeys% to send keys to the keyboard buffer
set SendKeys=CScript //nologo //E:JScript "%~F0"

rem Start the other program in the same Window 
start "" /B "M:\FILENAME.yxmd"

set /P "=Wait and send a command: " < NUL
ping -n 15 -w 1 127.0.0.1 > NUL
%SendKeys% "^r"

set /P "=Wait and exit: " < NUL
ping -n 2 -w 1 127.0.0.1 > NUL
%SendKeys%  "exit{ENTER}"

goto :EOF


@end

0 个答案:

没有答案