% ~ In Batch Processing ~ Special characters

Source: Internet
Author: User

For details, refer to: Call /? -- (Refer to the call command in batch processing)

% ~ Dp0 meaning: Path to the drive letter of the current batch processing (excluding the file name)

Explanation: % ~ Dp0 "D" is the abbreviation of drive, that is, drive, disk, "P" is the abbreviation of path, that is, path, directory

 

Option Syntax:

~ 0-delete any quotation marks (") and expand % 0
% ~ F0-extend % 0 to a fully qualified path name ("F" is file, that is, file)
% ~ D0-expand % 0 to only one drive letter
% ~ P0-only expand % 0 to one path
% ~ N0-only expand % 0 to one file name ("N" is the name file name)
% ~ X0-only expand % 0 to one file extension
% ~ S0-the expanded path only contains short names ("S" is short, short)
% ~ A0-extend % 0 to the file attribute ("A" is attribute, that is, attribute) of the file)
% ~ T0-extend % 0 to the file date/time ("T" time)
% ~ Z0-expand % 0 to the file size (size)
% ~ $ Path: 0-find the directory of the environment variable in the path and expand % 0
The first fully qualified name found. If the environment variable name
This key combination is expanded
Null String

You can combine modifiers to get multiple results:

% ~ Dp0-expand % 0 to only one drive letter and Path
% ~ Nx0-only expand % 0 to one file name and extension
% ~ Fs0-only expand % 0 to a complete path name with a short name
% ~ DP $ path: 0-find the directory of the environment variable in the path and expand % I to the first drive letter and path found.
% ~ Ftza0-expand % 0 to Dir similar to the output line

% 0 indicates the current batch processing file
If 0 is changed to 1 as the first file, 2 is 2nd

Common Syntax:

% 0 -- indicates the batch processing file itself
% ~ D0 -- indicates the drive letter of the batch processing.
% ~ Dp0 -- drive letter path

Another articleArticleAs you can see, it is not written by myself (I hop)

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.