General discussion

Locked

VBScript

By wood_jared ·
I need to run a VBScript in the backround that will check the date and time and run a bat file at a certain date and time...

this is what I have so far...

Option Explicit

dim MyDate
dim MyTime

stop
MyDate = date
MyTime = time

Do
If MyDate = ##/02/####
then goto next
else goto loop

If MyTime = 12:00a
then goto next
else goto loop

Loop

Run c:\test.bat

End Function

Any suggestions?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

VBScript

by SteveD In reply to VBScript

Well, I can give you the right syntax for looping until a certain date and time, but I'm darned if I can see a way to run the batch file. "Run c:\test.bat" just isn't going to work. There is no Run statement in vbs.

Here's the loop to wait for a date/time:

Option Explicit
dim MyDate
MyDate = Now
While MyDate < "5/13/01 00:00"
MyDate = Now
Wend

Collapse -

VBScript

by wood_jared In reply to VBScript

Poster rated this answer

Collapse -

VBScript

by eSadacca In reply to VBScript

The Task Scheduler and AT service are designed to do just this.

If you're running IE5 or higher, you'll find the Task Scheduler in "My Computer".

If you're running NT (with IE4 or less), run "at /?" at the command prompt; note that you mayneed to start the "Schedule" service.

Collapse -

VBScript

by wood_jared In reply to VBScript

Poster rated this answer

Collapse -

VBScript

by wood_jared In reply to VBScript

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums