0

If have a wsf file which remote logs into another machine via telnet, executes a command, and logs out.

I have it set up in task scheduler to execute once a day.

If I manually run it in task scheduler the script works.

If I manually run in outside of task scheduler the script works.

While watching it run in task scheduler (logged in via remote desktop, FWIW), "Running" appears for a little while and then disappears. The task is never actually executed.

I have the task configured to "Run as" my network user (I personally can't try running it as SYSTEM as I don't have the SYSTEM password, although if that will fix the problem I can get the Admin to fix that).

I have a start in directory (omitting a start in directory doesn't help).

I am calling the script thusly:

cmd.exe /c "F:\util\startextr.wsf"

I've tried it using just cmd.exe "F:\Util...", cmd.exe f:\util..., just f:util... (and other obvious variations). Nothing helps.

I've changed the permissions on cmd.exe to included "BATCH", with no success.

???

Thanks, --sw

reply to question: It's not being killed by the time out kill process. A little while means 10-15 seconds.

4

1 回答 1

1

我也有同样的问题; 我还没有答案,但到目前为止我发现我的脚本使用“sendkeys”命令,该命令似乎将密钥发送到所选的任何窗口。当您运行交互式时,您会看到出现的命令窗口和那里的脚本类型......当您运行任务时,窗口在后台打开并且脚本类型......我不知道确切的位置,但可能不在您期望的窗口中!这解释了为什么它以交互方式工作而不是任务......

于 2015-06-08T14:36:19.003 回答