WScript Sleep- Exercise Desktop Remainder

Introduction - WScript.Sleep



                  Suspend the execution of the current script for the specified number of milliseconds.


WScript.Sleep Time


         Time is the delay in milliseconds.


          WScript.Sleep (10000)

          WScript.Echo (“10 Seconds have passed”)

A script can force itself to pause by calling the WScript Sleep method. The Sleep method accepts a single parameter that indicates how long, in milliseconds, to pause the script. (There are 1,000 milliseconds in a second and 60,000 milliseconds in a minute.)

You will need to use the Sleep method in your scripts when:

·         Your script must wait for an event to occur before continuing to run.

·         You want your script to periodically check the status of a system parameter (for example, checking processor usage every 10 seconds).

·         Your script is interacting with a user and you want to slow the interaction to a usable speed. For example, when displaying events retrieved from an event log, you might want to insert a pause, giving the user time to read the first event before displaying the next event.


   VBScript for creating countdown time is easy with the WScript.Sleep method. These sleep reads in one variable integer time in milliseconds.Wscript.sleep will suspend your script for the indicated number of milliseconds.

Suspension is useful when you need to add a delay or a pause to your project. For example, a delay is often necessary when sending keystrokes via VBScript .Another neat use for the WScript.Sleep function is to create a timer or reminder.

Why required Desktop Exercise reminder?

Remember the days when “work” meant manual labor with a side of blood, sweat, and tears? Neither do we. These days it seems we’re more likely to log hour after idle hour with our bums glued to our seats. And while you may be an Excel champ by day and gym rat by night, recent research suggests that the recommended 30 minutes of cardio five times per week may not undo the health risks of a sedentary lifestyle.

So what’s a worker chained to his or her desk to do? Luckily short bouts of aerobics, strength exercises, and stretching in between conference calls and Gchats can help improve fitness levels and heart health  . While these deskercises, or desk exercises for the cubicle-bound, won’t promise Olympic mile times or six-pack abs, they might just improve strength and burn a few extra calories to boot. Our day to day office life we may forgot to do some task for that we required remainder which can make us alert to doing a particular task in particular time for these I designed windows based script to execute.

This script act us reminder every 30 minutes to do action like The Twinkle Top, Stretch your legs

Example:  WScript.Sleep

Desktop Exercise reminder script




Dim dtext

Dim dTimer


dtext=InputBox("Do you want me to remind you anything later on?","Reminder")

dTimer=InputBox("Enter timer interval in minutes","Set Timer") 'minutes


do until IsNumeric(dTimer)=True

  dTimer=InputBox("Invalid Entry" & vbnewline & vbnewline & _

         "Enter timer interval in minutes","Set Timer") 'minutes



if dTimer<>"" then


  WScript.Sleep dTimer*60*1000 'convert from minutes to milliseconds

  t=MsgBox(dtext & vbnewline & vbnewline & "Restart Timer?", _

    vbYesNo, "It's been " & dTimer &" minute(s)")

  if t=6 then 'if yes

       'continue loop

  else 'exit loop

       exit do

  end if


end if

How to Create the WScript file:

1. Create new file Timer (filename).vbs

2. Open Timer.vbs (if necessary, right click and open with notepad)

3. Paste above code in the file

4. Save the file

Execute VBScript:

There is number of way to execute a VBScript. I show below few options how to run the script

1. Double click the file

2. Open Command Prompt Cmd.exe

         a. Navigate file location Timer (filename).vbs

         b. Type wscript Timer.vbs

         c. Type cscript Timer.vbs

        d. Type run Timer.vbs


When executed this script prompts the user to set remainder message to remind and set timer using the Input box function. Each time the timer expires, a message box gives you the option to restart timer. I used this script to remind me to do twinkle top every 30 minutes at the office. If you’re an office worker, this example is sure to help you battle the sedentary lifestyle.





Application proposal - WScript.Sleep

1.       Timer scheme

1.       Exercise Timer (The slog then log, The Mover and Shaker, The Seated Leg raise etc.)

2.       Tea Timer

3.       Lunch Break Reminder

2.       Other scheme

1.       Pause Code while External Application Loads

2.       Wait for a Connection to become Established

3.       Add a delay before using SendKeys

1.       Delay sending Login information

2.       Pause FTP commands

4.       Add a delay to a print job

5.       Delay to send the email

6.       Shut down/logoff/hibernate the personal computer with in specified time

7.        Monitor the remote server popup alert message to admin if process exceeds utilization.



Identifying Web Elements using Selenium Webdriver

What is Web Element?             &n...

Read More >

M.S Dynamics Webinars Registration

h2{ margin-bottom:10px;}#wrapper{ margin: -40px auto 0; }#wrapper h1{ color:#FFF; text-align:center...

Read More >

What are Frames? How to handle frames in Selenium WebDriver with C#?

IFrame (FullForm: Inline Frame) is an HTML document that is included in another HTML document and is...

Read More >

Locking VMs and Resources Groups with Azure Resource Manager using Azure PowerShell

Hello Folks!In this blog post we will be talking about locking down your Azure Resources with Azure ...

Read More >


VSTS RollUp is a web service which provides summed values of select fields for all child work items ...

Read More >

Database deployment using GitHub Actions

In this blog, I will be showing how to export the database file from SQL Server and import the same ...

Read More >

What's New in Microsoft Dynamics NAV 2017

We were hearing about Dynamics NAV 2017 since long time that it will be releasing by the end of 2016...

Read More >

Webinar -The curious case of native versus the cross platform development of mobile apps

The curious case of native versus the cross platform development of mobile appsBusiness is often cau...

Read More >

How to Build an Online Help Page in Microsoft Dynamics NAV 2013 R2

Online help page is a web page which displays information in a web browser when user presses the key...

Read More >

Partnership Program

We understand that the world of technology is changing rapidly from day to day and businesses have m...

Read More >


Try DevOpSmartBoard Ultimate complete Azure DevOps End-to end reporting tool

Sign Up

  • Recent
  • Popular
  • Tag
Monthly Archive

Contact Us
  • *
  • *