Alternatives to using WScript.Sleep in a Custom Action

Description:

Sometimes in our Custom Actions we need to pause the script execution, for example when we’re manipulating processes. Since we can’t use Wscript.Sleep from a Custom Action we need another way of pausing the execution of a script. Here I present two alternatives to using WScript.Sleep in a Custom Action.

Source:

NA

Script 1:

Script 2:

3 thoughts on “Alternatives to using WScript.Sleep in a Custom Action

  1. i want to run a script whole day. it ll do some works on some particular time only. (e-x) executing a batch file at 6:00pm. if i use “wscript.sleep 10000” then its giving some outof memory errror. how can i avoid that.?

  2. Hi.  Remember that these scripts were intended for Custom Actions.  Also it depends how you’ve authored your scripts and your loops.  Please post your script over at ITNinja (or in some other forum) and I’m sure somebody will point you in the right direction!

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.