Is there an environment variable in Windows 7 that is set to the name of the currently running script when I run a script?
I'm looking for the Windows equivalent of the Linux variable
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Some more info...
%0 is a bit quirky. Depending on how you call the script you will/will not get PATH and extension.
To always get the fully qualified script name this should work %~f0
To learn about how %~f0 works ... at a command prompt enter for /?
FYI... just about every batch language term responds to /?
if /? call /? del /? rem /? cmd /? (a lot of interesting info for this one)
For a list of batch language terms, at the command prompt enter just help