|
|
|
Tech » Freeware » Win32 » wait
wait
|
![]() |
Beschreibung |
AbstractConsole program that waits for a given condition. This is particularly useful in batch files that start a sequence of programs that depend on each other. Duration: wait N seconds. Window title: wait until a window is found, that conatins a given string in the caption. Process name: wait until a process with a given name is running. Process window: wait until a process with a given name is running and has an visible window open. |
Systemanforderungen |
RequirementsWindows XP or Windows NT >= 4 or Windows Server
> 2000 |
Installation |
InstallationCopy/extract to any folder. (For easier access, add this folder to your PATH environment variable) |
Anleitung |
Usagewait [OPTIONS] [<INPUT] [>OUTPUT] Enter wait -? for a list of options. Samples:
|
Known issuesThis program uses psapi.dll, so it propably won't run on Windows 3.1, 95, 98 or ME. |
2008-04-07 |
v1.0 |
Released |
| cmd.exe |
|---|
C:\Prj\cpp\wait\release>wait -?
wait v1.0 (c) 2008 martin@wwwendt.de -- Apr 7 2008
Usage:
wait SECONDS [OPTIONS] [MATCH, ...]
Options:
-? Print this help.
-process Wait until a process named MATCH is running.
-procwin Wait until a process named MATCH has a visible top-level window.
-window Wait for a visible top-level window title that contains MATCH.
(This option is the default and may be omitted.)
-q Quiet mode.
-p Wait for [Enter] when done.
-dump Dump task list.
Examples:
> wait 2
Wait 2 seconds.
> wait 10 "readme.txt - Editor"
Wait until 'readme.txt' is open in the Windows Editor.
Then return ERRORLEVEL 0. Timeout after 10 seconds with ERRORLEVEL 1.
> wait 0 "Mozilla Firefox"
Check: return ERRORLEVEL 0, if Firefox is running. ERRORLEVEL 1 else.
> wait 10 -process firefox.exe iexplorer.exe
Wait until Firefox OR Internet Explorer appear in the tasklist and
return ERRORLEVEL 0.
Timeout after 10 seconds with ERRORLEVEL 1.
> wait 10 -procwin firefox.exe
Return ERRORLEVEL 0, when Firefox has a visible top-level window.
Timeout after 10 seconds with ERRORLEVEL 1.
Matching is case-insensitive. If more than one MATCH is given, then OR is used.
Use double quotes (") if MATCH contains spaces.
Check the process list in the Task-Manager for the process name of a running
process.
Skript examples:
Open a url and wait for the browser to open:
START http://google.com/
wait 10 "Google - "
Start a server if neccessary, then open a url, when it runs:
wait 0 -process nhttp.exe
IF NOT ERRORLEVEL 1 GOTO FOUND
start nhttp.exe
wait 30 nhttp.exe
wait 5
:FOUND
start http://localhost:8080/
C:\Prj\cpp\wait\release> |