简体   繁体   中英

WSF script which calls telnet won't run in task scheduler

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.

I have the same problem; i do not have an answer yet but what i have found so far is that my scripts uses the "sendkeys" command which seems to sends the key to whatever windows that's selected. When you run interactive, you look at the command windows appear and the script types there... when you run with the task, the windows open in the background and the script types... well i don't know where exactly but probably not in the windows that you expect! That explain why it works interactively and not with task...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM