Roger wrote:
>The %0 refers to the filename of the bat program, not including the
>extension, or do I have that wrong?
%0 refers to how the BATch file was started. For instance the file
something.bat located in c:\somedir can have these as %0:
c:\somedir\something
c:\somedir\something.bat
..\something
c:\SomediR\..\soMEdir\something.BAt
And these are just examples that I figured out now. It gets even more
complicated in this scenario:
subst z: c:\somedir
z:something.bat
In some cases you want to know the true name of the directory. So you'll
need to run "truename %0", output the answer somewhere and figure out what
to do with it. It should hereafter always be C:\SOMEDIR\SOMEFILE.BAT so you
can now know that removing BAT for EXE will work (unless you need to be in
the directory and thereby complicate things even more).
"Batch files, a minute to learn, a lifetime to master" (actually that's
Othello not Batch files).
//Bernie