Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Wshshell.run "cmd.exe" doesn?t work in scheduler

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1067
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
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!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Wshshell.run "cmd.exe" doesn?t work in scheduler - 6/17/2004 7:30:49 PM   
  Chencho

 

Posts: 1
Score: 0
Joined: 6/17/2004
From:
Status: offline
Hi , everybody.

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.
 
 
Post #: 1
 
 Re: Wshshell.run "cmd.exe" doesn?t work in sc... - 6/17/2004 8:44:58 PM   
  evildad

 

Posts: 5
Score: 0
Joined: 5/25/2004
From: United Kingdom
Status: offline
Chencho,

A stab in the dark here, but have you tried "cmd.exe /c"

evildad.

Paul F

(in reply to Chencho)
 
 
Post #: 2
 
 Re: Wshshell.run "cmd.exe" doesn?t work in sc... - 6/18/2004 6:29:22 AM   
  mbouchard


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?

Mike

(in reply to Chencho)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Wshshell.run "cmd.exe" doesn?t work in scheduler Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts