Batch processing experience

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.