You are here

Delay in .bat file?

5 posts / 0 new
Last post
King Tut
Offline
Last seen: 12 years 6 months ago
Joined: 2006-06-15 05:47
Delay in .bat file?

What would be the easiest way to produce a delay in a .bat file? such as waiting for ten seconds then continuing or something like that? I'd prefer if there was a simple way to set how long you wait...

Ryan McCue
Ryan McCue's picture
Offline
Last seen: 14 years 8 months ago
Joined: 2006-01-06 21:27
Well,

Try the ones from here
----
Ryan McCue.
Blog.
So all that Airbus-delay trouble over here in Europe is because of YOU!
Simeon.

"If you're not part of the solution, you're part of the precipitate."

shookmon
Offline
Last seen: 7 years 2 days ago
Joined: 2007-02-21 16:26
Routine I use to countdown

Routine I use to countdown to fire my start up software if I'm at work, but not when I'm on the road. Just put the batch file in your StartUp group. I don't remember where I found the core algorithms, but it works nicely.

BTW, my U: drive is a network share that only exists if I connect at the office.

@ECHO OFF
TITLE 20 AutoStart Routine

ECHO.
ECHO.
ECHO.
ECHO       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO       º                                                                 º
ECHO       º Please wait while I determine if the office Network is online.  º
ECHO       º                                                                 º
ECHO       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.

:loop
SET cnt=%cnt%*
PING -n 2 127.0.0.1 > NUL
IF "%cnt%"=="*" TITLE 19 AutoStart Routine
IF "%cnt%"=="**" TITLE 18 AutoStart Routine
IF "%cnt%"=="***" TITLE 17 AutoStart Routine
IF "%cnt%"=="****" TITLE 16 AutoStart Routine
IF "%cnt%"=="*****" TITLE 15 AutoStart Routine
IF "%cnt%"=="******" TITLE 14 AutoStart Routine
IF "%cnt%"=="*******" TITLE 13 AutoStart Routine
IF "%cnt%"=="********" TITLE 12 AutoStart Routine
IF "%cnt%"=="*********" TITLE 11 AutoStart Routine
IF "%cnt%"=="**********" TITLE 10 AutoStart Routine
IF "%cnt%"=="***********" TITLE 9 AutoStart Routine
IF "%cnt%"=="************" TITLE 8 AutoStart Routine
IF "%cnt%"=="*************" TITLE 7 AutoStart Routine
IF "%cnt%"=="**************" TITLE 6 AutoStart Routine
IF "%cnt%"=="***************" TITLE 5 AutoStart Routine
IF "%cnt%"=="****************" TITLE 4 AutoStart Routine
IF "%cnt%"=="*****************" TITLE 3 AutoStart Routine
IF "%cnt%"=="******************" TITLE 2 AutoStart Routine
IF "%cnt%"=="*******************" TITLE 1 AutoStart Routine
IF not "%cnt%"=="********************" GOTO loop

TITLE 0 AutoStart Routine
IF EXIST U:\FolderFinder.txt GOTO NetFound
CLS
ECHO.
ECHO.
ECHO.
ECHO       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO       º                                                                 º
ECHO       º     The office Network has been determined to be offline.       º
ECHO       º                            Good-bye.                            º
ECHO       º                                                                 º
ECHO       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
PING -n 4 127.0.0.1 > NUL
GOTO end

:NetFound
CLS
ECHO.
ECHO.
ECHO.
ECHO.       ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO.       º                                                                 º
ECHO.       º      The office Network has been determined to be online.       º
ECHO.       º           Please wait while I start your applications.          º
ECHO.       º                                                                 º
ECHO.       ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
PING -n 4 127.0.0.1 > NUL

CD c:\
CD "Program Files"
CD "Microsoft Office"
CD OFFICE11
START OUTLOOK.EXE  /recycle
ECHO. Outlook started.
PING -n 11 127.0.0.1 > NUL

::CD c:\
::CD "Program Files"
::CD Salive
::START serversalive.exe
::ECHO. ServersAlive started.
::PING -n 11 127.0.0.1 > NUL

:end
PING -n 21 127.0.0.1 > NUL
EXIT

Michael D. Shook

Pazy
Offline
Last seen: 16 years 11 months ago
Joined: 2007-06-17 13:14
Out of interest would the

Out of interest would the same batch file (ignoring outlook.exe etc.) work on Linux? I.E. is it the same commands or are they windows specific?

John Bentley
John Bentley's picture
Offline
Last seen: 14 years 10 months ago
Developer
Joined: 2006-01-24 13:26
No. Windows and Linux

No. Windows and Linux commands are totally different.

cowsay Moo
cowthink 'Dude, why are you staring at me.'

Log in or register to post comments