Saturday, November 20, 2010

How would you get a batch file to change its directory back to its starting directory?

I am writing a batch file that will set some files up on the c: drive whereas the batch file it running on my flashdrive whoes symbol changes from computer to computer. Part way through, the only way to acomplish the task is to go to the c: drive, but how would I get the batch file to bring itself back to the original directory from which it was launched on the flashdrive.



Basically: I want to have ';cd'; direct the command prompt to its directory of birth (where it was started).How would you get a batch file to change its directory back to its starting directory?
There are programs called 'push' and 'pop' (and techniques to do the same thing). You push the current directory, do anything you want, then pop and you're back to where you were when you pushed. (4DOS had these as internal commands.)



http://www.fpschultze.de/smartfaq+faq.fa is one way to do it.
  • >windows update
  • clearing up my skin
  • No comments:

    Post a Comment