Question

How can a batch file by itself see where it is located?

Was it helpful?

Solution

%0 is the name of the file. %~dp0 will be the absolute location of the file, with d being the drive, p being the path, and 0 being the filename.

OTHER TIPS

Just call "cd"

set WORKING_DIRECTORY=%cd%

Used to be %~dp0, but that's not working for me in Vista.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top