Close batch script 5 seconds after last command?

Posted on 2008-11-16
Last Modified: 2012-05-05
Hi  currently have the following batch script runnign on log-on:
(see code)

I want to be able to pause the window for a set of time before it closes after the log-on sequence. Is this possible? Will I have to call in another type of script?

For example, I want the window to close about 5 seconds after "Logon Complete!!" - just enough time to display the message to users.


title Logging you on to the domain

@echo off


mode con:cols=80 lines=60

echo ******************************************************

echo Please Wait....                                    

ECHO Personal Settings Are being Applied to %username%  

ECHO You are currently connected to %computername%      

echo ******************************************************



echo Identifying and connecting your network drives



call \\server\netlogon\mapdrives.bat

echo Downloading your desktop icons.....



echo Downloading your Internet Favourites.....



echo Logon Complete!!

Open in new window

Question by:sys_admin_pic
    LVL 6

    Expert Comment

    you can add a command in the last line where you need a wait.
    sleep 5
    thats what i would use on my batch files to give a pause of specified time.
      sleep.exe is not available by default and is a part of the resource tools
    you need to download from the
    LVL 6

    Expert Comment

    Just to add the command is
          sleep      time-to-sleep-in-seconds

    -- popularbhaskar
    LVL 2

    Accepted Solution

    Easiest way without installing extra software is just to ping localhost
    ping -n 10 > nul

    Open in new window


    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
    Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  ( Here (http…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    728 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

    21 Experts available now in Live!

    Get 1:1 Help Now