"Joseph Morales" <> wrote in message
news:65AACE0F-2F10-44E2-9224-...
> "Jon" wrote:
>> and the second line
>> Set WD=%WD:somename.bat=%
>> removes the string 'somename.bat' from it ...
>
> Thanks for the explanation! It turns out that I had a typo that was
> keeping
> this from working -- I typed a 0 instead of an O in my filename. (I hate
> it
> when that happens!)
> Now your example works, and I also understand why it works.
>
> Now, just to push my luck... Is there any way to not have to hard code the
> bat file name? That way if I retitle the bat file later, it won't break
> the
> code.
> --
> Joseph Morales
Good question. It would be a laborious to have to hard code that into every
batch file, and would also cause problems if a batch file were renamed.
Looks like there's a similar discussion in this thread, with some code
samples in it. Looks like there is a more generic solution in there.......
"run as administrator" changes default directory
http://groups.google.com/group/micro...df42c859cb0ba0
--
Jon