Thought of something. After running the BAT file I want to rename or delete the bat file so it can't be run again. I know I could set a variable using the %CD%, but I noticed that is the bat file is run from the command as follows ...
c:
cd program files\bat
"folder\edit.bat"
If I set local=%CD% in the bat file that is run, I will get 'C:\Program Files\bat' as my local variable. Is there a way around this to force it to take the actual location of the bat file so I can remove it?