Batch Processing commands-usage

Source: Internet
Author: User

1. Disable echo

In this way, only the commands output by ECHO will be displayed.

@ Echo off

 

2. Display Information

Play with ECHO batch processing! /* Display batch processing for fun! */

 

3. No questions are asked to delete the file.

Del/f/S/Q % systemdrive % \ *. tmp/* directly delete the file named TMP under the System Disk */

 

4. Batch Processing suspended

Echo. & pause/* pause batch processing and press any key to continue */

 

5. Add comments

Rem determines whether to start the backup/* defines the comment, and "determines whether to start the backup" is the comment */

6. variable definition and usage 

Set rootpath = D: \ out \ SSO \ utrustsso3.0.3 \ ssoserver \/* set the copy Source Path */
Set backuppath = D: \ backup \/* set the path of the replication target */
Copy "% rootpath % \ sysconfig" "% backuppath % \ sysconfig \"

/* Start copying with the variable. The variable is called by "% variable name % */

7. Get input data Set/P choose =/* "/P" indicates that the input data is obtained and put into the choose variable */ 

 
8. data comparison If % choose % = 1/* determine whether the value of the variable choose is equal to 1 */ 

 
9. Jump Goto end/* jump to the end and start execution */ 

: End/* define an end segment */
Echo program end/* return the "program end" information, which is the content in the end section */

 
10. Call other batches 

Call % ldappath % \ slapd-ssotemp \ db2bak "% backuppath % \ data"
/* Call the batch processing at % ldappath % \ slapd-ssotemp \ db2bak,

And pass the parameter "% backuppath % \ data" to the batch processing */

 
11. Create a folder MD % backuppath % \ data/* Create a folder named data at % backuppath % */ 

 
12. Copy an object Copy "% rootpath % \ sysconfig" "% backuppath % \ sysconfig \" 

 

/* Copy the file in % rootpath % \ sysconfig to % backuppath % \ sysconfig \ location */

 
For more details, enter help in the command line... 

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.