/build/static/layout/Breadcrumb_cap_w.png

Batch file help to run exe

Hi

I need a batch file command to run the exe from other folder (sub folder).

Please help me
Thanks.

0 Comments   [ + ] Show comments

Answers (4)

Posted by: dyehardfan 13 years ago
Second Degree Blue Belt
0
start /wait somepathtofile\somefile.exe /some switches
Posted by: pjgeutjens 13 years ago
Red Belt
0
if it's a subfolder this little line of code might be of use to you:

pushd %~dp0
-- Do Stuff --
popd

this will basically do a cd to the current directory, you can work with relative dirs from there.

Rgds,

PJ
Posted by: reethu005 13 years ago
Orange Belt
0
Hi PJ,

The scenario is,
There are 2 folders Folder A and Folder B.
Folder A has a batch file and setup.exe. Folder B has a MSI.
The batch file runs the setup.exe. After installing the setup.exe, I need to install the MSI which is in Folder B.
These 2 folders are in a network shared drive which will change later.

My question is how to specify the network path with pushd command.

Thanks.
Posted by: pjgeutjens 13 years ago
Red Belt
0
as long as the folder structure on the drive share is predictable you can play around with pushd and popd.

For your specific example, let's assume you're running the script from folder A
pushd %~dp0 //get the Folder A path and go to it
pushd .. //Go to the parent folder
set parent=%cd%
popd //go back to the current folder
-- do what you need to do here--
pushd "%parent%\Folder B" // go to folder B
-- do what you need in folder B --
popd

Guess I'm telling you to just play around with it abit [:D]

PJ
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ