All Forums >> [Scripting] >> WSH & Client Side VBScript >> Wshshell.run "cmd.exe" doesn?t work in scheduler Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I?m new in the world of vbs, and I need big help for a script in Windows 2000 Advanced Server and Windows 2000 Professional.
This script works perfectly when I do double click on it, but when I try to program a task with the scheduler (AT and Task Scheduler of Windows), Windows says that it?s running, and when the task is finalized, there is only the file that is before WshShell.Run "cmd.exe". The name of the file is num2.txt, that is created, but not edited.
That means that the script do the first orders, but when it arrives to this point, it doesn?t continues with the next instructions.
I tried to manipulate the style of window, but how the script uses keystrokes, only works to me with style 9.
This is the code:
The program calls another program (CPQLOCFG), and it sends to it the parameters to execute. These parameters are included inside the file IP.txt (it?s full with ip address). the script is full of redirections for save all the events.
Thanks for your help, and sorry by my poor level of english.
Posts: 1814
Score: 12
Joined: 5/15/2003
From: USA
Status: offline
Chencho,
Is the computer locked / Logged off when you are running this via scheduler? If so, I do not think it will work as SendKeys will not work when the PC is locked.
I was wondering why you were using sendkeys to send commands via a CMD window?