tags:

views:

256

answers:

4

I'd like to create a batch file that uses (e.g. prints) its full path:

c:\tmp\foo> nice.bat

I am c:\tmp\foo\nice.bat
+4  A: 

You can use %~f0 (e.g. "echo %~f0").

Tomer Gabel
Excellent, thanks.
ripper234
+3  A: 

Use %0 and some modifiers

Simon Groenewolt
+2  A: 

try this:

 echo I am %~f0
akf
+1  A: 

%~dp0 from memory is the full path to the batch file.

EDIT For more variable substitution run call /?

Igor Zevaka