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)