Last week, my colleague asked me a question about writing batch files. What he wants to do is to copy files in depth, which involves parsing directories and file names. He complained for a long time and said it was not easy to use. But I found that,
MS
In fact, we have already done this job. For example:
% ~
1
You can remove the quotation marks on both sides of the parameter.
% ~
D1
You can get the drive letter.
And so on.
This is the parameter table about the parameters in this document.
Modifier
|
Description
|
% ~ 1
|
Expands % 1 and removes any surrounding quotation marks (""). |
% ~ F1
|
Expands % 1 to a fully qualified path name. |
% ~ D1
|
Expands % 1 to a drive letter. |
% ~ P1
|
Expands % 1 to a path. |
% ~ N1
|
Expands % 1 to a file name. |
% ~ X1
|
Expands % 1 to a file extension. |
% ~ S1
|
Expanded path contains short names only. |
% ~ A1
|
Expands % 1 to file attributes. |
% ~ T1
|
Expands % 1 to date and time of file. |
% ~ Z1
|
Expands % 1 to size of file. |
Detailed information about batch files is available on the Microsoft Website:
Http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/batch.mspx? MFR = true