I want to set an environment variable inside a .bat file to the absolute filename of this .bat file.
Example:
filename: c:\a_dir\mybatch.bat
inside this I want to run something to set an environment variable, let's say batname, so that I then can run:
CODE
echo %batname%
This should give me
CODE
c:\a_dir\mybatch.bat
Is there any way to do this while staying in pure dos compatible .bat?
Thanks for any tips!
EDIT: It would also be okay (or maybe even easier) to just write the drive and dir in a variable.
(In this example c:\a_dir) I know the name of the batch file, anyway.
