Batch processing, what does%~d0 CD%~dp0 mean
~dp0 "D" is the abbreviation for drive, which is the driver, disk, "P" is the path abbreviation, that is, the directory
The CD is going to go to this directory, but I think cd/d%~dp0 is better.
Option syntax:
~0-Remove any quotation marks ("), expand%0
%~F0-Will%0 Expands to a fully qualified path name ("F" is file, that is, files)
%~D0-will only%0 Extend to a drive letter
%~p0-will only%0 Extend to a path
%~n0-will only%0 Expand to a file name ("n" is the name file name)
%~x0-will only%0 Expand to a file name extension
%~S0-The expanded path contains only short names ("s" for short, shorter)
%~A0-Will%0 File attributes that are expanded to files ("a" is attribute, that is, attributes)
%~t0-Will%0 Date/time of extension to file ("T" times)
%~z0-Will%0 Expand to file size (size)
%~ $PATH: 0-Find the directory that is listed in the PATH environment variable and add%0 Expand
To the first fully qualified name found. If the environment variable name
is not defined, or the file is not found, the key combination is expanded to
Empty string
You can combine modifiers to get multiple results:
%~dp0-will only%0 Expand to a drive letter and path
%~nx0-will only%0 Expand to a file name and extension
%~FS0-will only%0 Extend to a full pathname with a short name
%~dp$path:0-finds the directory that is listed in the PATH environment variable and will%I Expand
To the first drive letter and path found.
%~FTZA0-Will%0 Extended to DIR with similar output line
%0 is the current batch file
If 0 is replaced with 1 for the first file, 2 for the 2nd
Batch processing, what does%~d0 CD%~dp0 mean