For bat recommendation that is frequently used in batch processing

Source: Internet
Author: User

C disk to NTFS format Batch Processing Copy codeThe Code is as follows: @ ECHO OFF
@ ECHO.
@ ECHO. Description
@ ECHO ---------------------------------------------------------------
@ Echo ntfs is the recommended format for WinXP. Convert to NTFS format to improve hard disk storage
@ ECHO efficiency, and you can set access permissions to protect files. However, partitions in NTFS format are stored in DOS/WIN9X.
@ ECHO cannot be identified, which may cause inconvenience to junior users. Do not convert the data if necessary.
@ ECHO ---------------------------------------------------------------
@ ECHO.
Convert c:/fs: ntfs

Several Dangerous commands in Batch Processing
1. FORMAT disk formatting command
Because the FORMAT command can FORMAT the used disk and delete all files on the disk, before using this command, use the DIR command to check whether the content on the disk needs to be retained. In addition, avoid formatting the disk due to incorrect command input.
2. DISKCOPY command
During this command, the target disk is reformatted in the same format as the source disk, regardless of whether the target disk has been stored or not. Therefore, when using this command, on the one hand, check whether there are any useful files on the target disk, on the other hand, should also prevent the source disk and the target disk from being mistakenly formatted. You can write the source disk for protection before copying.
3. BACKUP disk BACKUP command
Before using this command, if parameter/A is not used, the original files on the target disk will be deleted. Therefore, check whether the content of the target disk is useful or use parameter/A for backup before backup.
4. DEL File Deletion command
Because this command can use wildcards * and? To avoid accidental deletion of a large number of files, we recommend that you use the DIR command to check whether the deleted files are correct before using this command. Then execute this command.
5. COPY a file
Because the COPY command overwrites the original file with the same name on the target disk when copying a file, the name of the target file should not be the same as the original file on the target disk.
Right-click ms-dos
Some tools are in CLI mode. It is not difficult to enter the folder where the tool is located from run to cmd. Let me tell you a simple way to enable windows to access the CLI at any time like linux.

Open the Registry Editor and find HKEY_CLASSES_ROOT \ Directory \ users/k "cd % L.

Note: "cd % L" is used to enter the current folder.

In the task manager, uninstall er.exeand run assumer.exe. The setting takes effect. No need to restart.

Right-click a folder and check if "go to DOS window" is displayed in the key? In this way, you can enable ms-dos anytime, anywhere, without the original trouble.
Shift: in the DOS batch processing, only the nine command line parameters % 1-% 9 are supported (% 0 indicates the command itself ), if you want your batch processing to support more than 9 command line parameters, you need to use the shift command. Every time you run the shift command, the command line parameter is shifted to the left, that is, % 2 is changed to % 1, % 3 is changed to % 2 ,..., and so on. In a simple example, you create a batch process named tstshift. bat. The content is as follows:
@ Echo off
Echo % 0
Echo % 1% 2% 3% 4% 5% 6% 7% 9
Echo % 1
: 1
Shift
Echo % 1
: 2
Shift
Echo % 1
: 3
Shift
Echo % 1
: 4
Shift
Echo % 1
: 5
Shift
Echo % 1
: 6
Shift
Echo % 1
: 7
Shift
Echo % 1
: 8
Shift
Echo % 1
: 9
Shift
Echo % 1
: 10
Shift
Echo % 1
Then run:
Tstshift 0 1 2 3 4 5 6 7 8 9 a running result is as follows:
D: \> tstshift 0 1 2 3 4 5 6 7 8 9
Tstshift
0 1 2 3 4 5 6 7 8
0
1
2
3
4
5
6
7
8
9
A is supported by all shift commands, while the shift function in 2000/xp/2003 adds a/n parameter to specify the shift from the nth parameter. The help of the shift command in 2000/xp/2003 is as follows:
D: \> shift /?
Change the location of replaceable parameters in the batch file. SHIFT [/n] If the command extension is enabled, the SHIFT command supports the/n command line switch.
The command starts to shift from the nth parameter; n is between zero and eight. For example, SHIFT/2 shifts % 3 to % 2 and % 4 to % 3 without affecting % 0 and % 1.

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.