Link to home
Start Free TrialLog in
Avatar of sys_admin_pic
sys_admin_pic

asked on

Close batch script 5 seconds after last command?

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.

Thanks
Matt

title Logging you on to the domain
@echo off
@COLOR 3e
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.
echo.
echo Identifying and connecting your network drives
echo.
echo.
call \\server\netlogon\mapdrives.bat
echo Downloading your desktop icons.....
echo.
echo.
echo Downloading your Internet Favourites.....
echo.
echo.
echo Logon Complete!!

Open in new window

Avatar of Bhaskar CP
Bhaskar CP
Flag of India image

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.
note:
  sleep.exe is not available by default and is a part of the resource tools
you need to download from the
http://www.microsoft.com/downloads/details.aspx?familyid=9d467a69-57ff-4ae7-96ee-b18c4790cffd&displaylang=en
Just to add the command is
      sleep      time-to-sleep-in-seconds

-- popularbhaskar
ASKER CERTIFIED SOLUTION
Avatar of joshlunsford
joshlunsford

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial