sleep command in batch script

Posted on 2004-11-10
Last Modified: 2008-11-12
I have a batch script that automatically starts/stops my sprint business connection software on my computer and i want to put a "sleep" command in it to give it some time (30 seconds) in between terminating the program and restarting it, but i dont know the specific code to use.  And i dont want to have to hit a key after the sleep part to start the service back up, i just want it to do it by itself.   Thanks
Question by:dlev15
    LVL 57

    Expert Comment

    by:Pete Long
    Hi dlev15,
    Sleep uses the following syntax:

    sleep (Time)

    Specifies the number of seconds to pause.


    Author Comment

    every time i do that it says 'sleep' is not recognized as either an internal or external command am i doing something wrong?
    LVL 104

    Accepted Solution

    sleep isn't a command on Windows XP or 2000 clients. You will have to use another trick.
    What I do is use a ping...

    rem Pause for five minutes
    ping -n 300>nul

    Adjust the value "300" to be the number of seconds that you want to pause for.


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Granting full access permission allows users to access mailboxes present in their database. By giving full access permission one can open and read the content of any mailbox but cannot send emails from that mailbox.
    ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
    To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now