Search code examples
batch-filemodifiers

What does %~dp0 mean


Possible Duplicate:
What does %~dp0 mean, and how does it work?

i had to modify a bat file in my work a few days ago. when i read the file,i found i didn't know what the string "%~dp0" means. i got the explanation of it on the microsoft web site. it said "%~dp0 Expands %0 to a drive letter and path." my question is what dose expand mean? why the result is driver letter + path,not driver letter + path + the name of bat?


Solution

    1. Expands means that the identifier is replaced with its value.

    2. dp means drive letter and path. %0 alone would include the filename.