Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Windows Scheduler does not work properly

Status
Not open for further replies.

litsz02

Technical User
Aug 26, 2004
45
US
Here's one that has our whole company stumped. We cannot figure this out for the life of us. Any assistance would be appreciated.

We have all Win 2000 servers, and I am trying to place a vbs script that creates a text file from a database and ftp's it to our main server. The process works fine (its in a .bat file) when I just double click. Everything works. HOWEVER, when i put it in the Windows scheduler, only the file gets created, but is not ftp'd over.

I set up the same thing in one of our PC's here (which is XP) and it works perfectly in the Windows Scheduler.

??????

The only difference I can see is on 2000, it runs the process as a background process, while the XP is a foreground process (I can see it executing).

Is there an option in 2000 Windows Scheduler that can make it so that it DOESN'T run as a background process? We've ben working for days and cannot find the problem, other than that.

Any help would DEFINITELY be appreciated...
 
Is it possible that the account that the scheduled task is being "run as" does not have rights to the FTP server?
 
No actually, because in the script, I am authorizing under a different password and user ID anyway. I can run the job fine manually also as the same account I am running the scheduler's "run as
 
Just wanted to post back my findings. The issue was because I was using a sendkeys command and with the window running in the background, the sendkeys object was not working right. I revised my script to have a simple FTP batch file separate from this other process I wrote to gather the data together. I have 2 scheduled jobs now and it works. I still havent figured out why 2000 does it as a background process, but whatever. its resolved.

Just wanted to follow up in case someone searched in the future and wanted to know a resolution. Thanks.
 
If you want to modify you VBScript to continue to use the sendkeys command, take a look at the sleep method. What you described typically happens when launching and app from a VBScript and the sendkeys part of your script completes before the application is actually launched. The Sleep method will give you app time to launch before sending the keystrokes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top