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?
Asked
Active
Viewed 69 times
0
-
1Write 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. – rojo Feb 25 '15 at 20:07
1 Answers
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.

Community
- 1
- 1

HavelTheGreat
- 3,299
- 2
- 15
- 34
-
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. – rojo Feb 25 '15 at 20:09
-
You might also be interested to know [this](http://stackoverflow.com/q/15656927/1683264), if you don't already. – rojo Feb 25 '15 at 20:11