Delay running of vbs/bat on Windows startup for 60 seconds


Recommended Posts

I have the following VBS script that runs on Windows startup:

Set WshShell = CreateObject("WScript.Shell") 
WshShell.Run chr(34) & "C:\processend.bat" & Chr(34), 0
Set WshShell = Nothing

processend.bat consists of a list of taskkill /t /im commands.

 

However, the VBS script is running when Windows starts up, before the background tasks are even running.

 

Is it possible to delay running the script for 60 seconds after startup?

 

Something like a timeout in the BAT, above the taskkill commands, perhaps?

Link to comment
Share on other sites

4 minutes ago, Daedroth said:

WScript.Sleep 60000

That would sleep the script for 60 seconds (time is specified in milliseconds).

Which line do I pop that on in the VBS?

Link to comment
Share on other sites

1 minute ago, Daedroth said:

In that three line script, I'd make it the first line.

Fantastic, thank you!

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.