1. Precise latency
Tool sleep.exe from Microsoft Win 2003 Resource Kit tools
2. Countdown
@ Echo offsetlocal enabledelayedexpansion & titleset return = for/L % I in (5) do (sleep 1 set/p "= z wait % I seconds" <nulset/P = % unggle % <NUL)
Because the batch processing still has special characters out of space, if you copy them directlyCodeThe attachment cannot be used. Download the attachment.
The countdown batch processing solves the problem of ignoring spaces in set/P = win7.Solution
Http://hi.baidu.com/lalafengche/blog/item/127b7389ca0190a90e244445.html
3. Determine whether the service is started
@ Echo offfor/F "tokens = 4" % I in ('SC query esri_sde ^ | findstr/I "state. *: "') Do (if/I" % I "=" STOPPED "(echo esri_sde has been stopped and started within 5 seconds. Please close e directly if it remains in the status: \ mine \ tool documentation \ knowledge accumulation \ dos and batch processing \ countdown. batnet start esri_sde) else (echo esri_sde has been started and stopped within 5 seconds; keep the status close E: \ mine \ tool documentation \ knowledge accumulation \ dos and batch processing \ countdown. batnet stop esri_sde) pause
4. Determine whether a process exists
@ Echo offtasklist | find/I "cmd.exe"> nulif errorlevel 1 (start cmd.exe) else (cmdsleep 3 has been started before echo)
Attachment: sleep.exe and batch countdown. batSource code.
Click here to download the attachment