Batch processing, what does%~d0 CD%~dp0 mean

Source: Internet
Author: User

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

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.