How to run the batch file through Wise script

Hi All,

I am trying to execute a batch file in my wise script.

I am copying the files from the network install location to a local dir in C:\
Ex: Set variable TestDIR to C:\Test
I then want to run the batch file say abc.bat
In my script I have tried using Execute Program command

.EXE Path: C:\WINDOWS\System32\cmd.exe
Command Line: "%TestDIR%\abc.bat" -silent
Default Directory: %TestDIR%
Checked the box - Wait for program to Exit

When I compile and execute this script:
I only see a command window on the screen with the cursor blinking on C:\TestDIR>

The batch file does not execute.

If I go to the command prompt on the same machine and open a command prompt.
Go to the TestDir and type abc.bat - silent (it executes).

Please Help me on how to excute the batch file through wise script.

Thanks in advance.

0 Comments   [ + ] Show comments

Answers (3)

Posted by: aogilmor 12 years ago
9th Degree Black Belt
methinks you want to do cmd.exe /w (close cmd window) and remove the -silent after the bat file
Posted by: reethu005 12 years ago
Orange Belt
Thanks for the reply,

The /w switch is not working for me. Also the batch file has to install silently (Batch file installs the IBM RAD iFix, It has to install silently).

Posted by: murali.bhat 12 years ago
Purple Belt
Use /C command

C:\WINDOWS\System32\cmd.exe /c "%TestDIR%\abc.bat"
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