from: http://www.2cto.com/ OS /201203/124198.html
% ~ In DOS batch processing ~ What does dp0 mean (Note: % 0 is the name of the batch file? I'm not in a hurry. For example, if you have a batch processing, the content of A. bat in the D:/QQ folder is CD/d % ~ Dp0 here CD/d % ~ Dp0 indicates CD/d:/QQ % 0 indicates the batch processing itself D:/QQ/a. Bat ~ DP is Variable Expansion D is expanded to the partition code D: P is expanded to the path/qq dp is expanded to the partition code path D:/QQ expansion variable syntax details: Option Syntax: ::~ I-delete any quotation marks (") and expand % I: % ~ Fi-extend % I to a fully qualified path: % ~ Di-only expand % I to one drive letter: % ~ Pi-only expand % I to one path: % ~ Ni-only expand % I to one file name: % ~ Xi-only expand % I to one file extension: % ~ The SI-extended path only contains the short name: % ~ Ai-extend % I to the file attributes: % ~ Ti-extended % I to the file date/time: % ~ Zi-expand % I to the file size: % ~ $ Path: I-find the directory of the environment variable in the path and extend % I: To the first fully qualified name. If the environment variable name: is not defined, or the file is not found, the key combination is expanded to: Null String: You can combine modifiers to get multiple results: % ~ DPI-only expand % I to one drive letter and Path: % ~ Nxi-only expand % I to one file name and Extension: % ~ FSI-only expands % I to a complete path name with a short name: % ~ DP $ path: I-find the directory of the environment variable in the path, and expand % I: To the first drive letter and path found.: % ~ Ftzai-extended % I to the Dir similar to the output line