0

我正在尝试设置一个每小时运行的任务,它将执行一个批处理文件。手动测试时,它似乎运行但没有执行我期望的过程。我正在测试它以打开 mstsc.exe,我收到控制台消息,并打开一个显示目录的新控制台窗口。不应该打开实际的 RDesktop 窗口。

@echo off 
tasklist /FI "IMAGENAME eq PRODUCER_69.exe" | find /I "PRODUCER_69.exe">nul &&(
echo PROCESS PRODUCER_69.exe IS ALREADY RUNNING! 
echo %DATE%
echo %TIME%
) || (
echo PRODUCER_69.exe IS NOT RUNNING! STARTING THE NEW PROCESS!
cmd /c start "C:\Windows\System32\mstsc.exe"
)
pause>nul
exit
4

1 回答 1

1

好的,我想我可能发现了我的错误……以下现在有效……

@echo off 
 tasklist /FI "IMAGENAME eq PRODUCER_69.exe" | find /I "PRODUCER_69.exe">nul &&(
 echo PROCESS PRODUCER_69.exe IS ALREADY RUNNING! 
 echo %DATE%
 echo %TIME%
  ) || (
 echo PRODUCER_69.exe IS NOT RUNNING! STARTING THE NEW PROCESS!
 cmd /c start "REMOTE DESKTOP" "C:\Windows\System32\mstsc.exe"
  )
于 2013-10-23T20:29:34.753 回答