?
Solved

Close batch script 5 seconds after last command?

Posted on 2008-11-16
3
Medium Priority
?
802 Views
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.

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

0
Comment
Question by:sys_admin_pic
  • 2
3 Comments
 
LVL 6

Expert Comment

by:question
ID: 22970478
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
0
 
LVL 6

Expert Comment

by:question
ID: 22970487
Just to add the command is
      sleep      time-to-sleep-in-seconds

-- popularbhaskar
0
 
LVL 2

Accepted Solution

by:
joshlunsford earned 500 total points
ID: 22972843
Easiest way without installing extra software is just to ping localhost
ping -n 10 127.0.0.1 > nul

Open in new window

0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

840 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