0

my command prompt is pointing to c:\users\myname directory . My program is location at C:\ETL\Shredding.exe . How shall I write the command line in batch file to run shredding.exe from this location?

1
  • 1
    Write it exactly as you have it in your question. c:\ETL\Shredding.exe "arg" etc. You don't have to have the working directory be the same as the program you're executing. Commented Feb 25, 2015 at 20:07

1 Answer 1

1

You can set the directory to be whatever you like within your batch file like so:

cd %DIRECTORY I WANT%

Alternatively, you can simply specify the full filepath of whichever program you want to run.

As rojo also said, you can use pushd directoryname if you want to be able to revert back to the original working directory later, after which you can use popd when you want to go return to the directory.

Sign up to request clarification or add additional context in comments.

2 Comments

also, pushd directoryname if you want to be able to revert back to the original working directory later -- then popd when you want to go back.
You might also be interested to know this, if you don't already.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.