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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling vbscript 1

Status
Not open for further replies.

cspm2003

Programmer
Nov 24, 2004
78
DE
Hi,
I have a problem with a vbscript:

Ive made a script and want it to run everymorning at 6am. The script works fine when I run it manually, or if I run the task manually, but when Im not logged on on the machine, the task doesnt run.

What do I have to do to make this task run?
 
I've run into this same problem. The cure seems to be to add it to the schedule using the command line AT command.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Hi mark,

This seams to work, but I have a little problem with the at command.

I tryed the following

Code:
at 06:30 /every:M,T,W,Th,F,S,Su c:\script.vbs

If I use the at command without the /every switch it works, but with it Im getting an errror message that the syntax is wrong. what would be the correct syntax to let the script run everyday at 06:30 am?
 
I figured it out, its just

Code:
at 06:30 /every: "c:\script.exe"

Strange that this isnt written on any webpage.

Thx for the tip though
 
damn, It worked once and now it doesnt work no more!

I dunno what Im going wrong, I read this site:
and nothing works. I tryed to assign just Monday as the day that the Task gets executed but nothing happens.

I tryed this command:

at 06:30 /every:Mo c:\script.vbs

I also tryed to execute a simple batch file to see if something happens, but my pc doesnt do anything. Does somebody know what Im doing wrong?
 
try to change the commandine that must be executed to:
"cscript.exe C:\folder\script.vbs"

Please tell me if I'm wrong I like to learn from my mistakes...
_____________________________________
Feed a man a fish and feed him for a day.
Teach a man to fish and feed him for a lifetime...
 
Hi K0b3,

that doesnt work aswell :(

If I execute the command manually it works just fine
 
The proper syntax would be like this
AT 06:30 /interactive /EVERY:M,T,W,Th,F,S,Su cscript "c:\go.vbs"

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Create a batch file that executes "cscript <path>\your.vbs"

Call that batch file using the GUI scheduler. Assign an administrative account to execute the schedule.

When the schedule runs, the administrative account will be "logged in as batch" and your script should run.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
The advantage of using the AT command is that it automatically schedules using the system account without having to supply credentials that might otherwise change.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
markdmac, the command you posted works perfectly fine on my pc (winxp pro) but when I use it on the server nothing happens. Even when Im logged in to the server it doesnt work.

PScottC, I tryed that and it doesnt work aswell
 
Does it get added to the schedule on the server and just not run? Does it list Error if you type AT at the command prompt? What do the event logs say. If there awas a failure it should be listed in the system log.

I hope you find this post helpful.

Regards,

Mark
 
Hi,

yes, it does get added to the schedule.
If I check it useing the at command after the task was supposed to run, it does not display Error
I checked the system log and it didnt have a error message at the time the task was supposed to run

is there a special log that the at command uses?
 
No special log.. What does your script do? Are you sure it is not running as a process in the background?

Try scheduling the script and watch the running processes. See if CSCRIPT launches in the background.

I hope you find this post helpful.

Regards,

Mark
 
The Script copys some files from the server to the users home directorys.

I just checked in the task manager, CSCRIPT doesn't launch.
 
OK, so can you give me a little more info to work with here? Why do you need to copy the same files from a server to a user's home directory. Can't you give the user a mapped connection to the files? Do the files change often?

Are the files big or small? How about doing the copy via a login script instead?

I hope you find this post helpful.

Regards,

Mark
 
Hi,

the files are html files, under 200kb used for time recording of the users that are at work. each user has a folder on the server with his files. now each user is supposed to get his files copied (later moved when users got used to it) to his home drive so that only he has access to them.

I've sceduled the skript at a win2k server now and everything works fine, so Im just gona leave it like that for now.

thanks for all your time mark
 
OK, glad you got it working. You could fairly easily keep this info all on the server and password protect it. Just a thought.

I hope you find this post helpful.

Regards,

Mark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top