Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Batch file for iexpress

I am trying to use iexpress to run my batch file which will execute the 2 exe & 1 msi files for me. when i try to do it manually, it works.

following is the code in my batch file.

Start /wait %CD%\1.exe /q
Start /wait %CD%\2.exe /q
msiexec.exe /i "%CD%\3.msi" 

but this doesn't seem to be working when i create an exe file from iexpress. enter image description here

Reference

Above mentioned article has some code(to copy files to temp folder) & but i am not able to understand the syntax.

MKDIR %Tmp%\<UNIQUE PRODUCT NAME>
XCOPY . %Tmp%\<UNIQUE PRODUCT NAME> /S /E /Y
%Tmp%\<UNIQUE PRODUCT NAME>\setup.exe
like image 972
Sangram Nandkhile Avatar asked Oct 07 '22 22:10

Sangram Nandkhile


2 Answers

The problem is that, as you can see from your screenshot, the batch file is being executed by command.com, not cmd.exe. (If you don't specify an interpreter, IExpress uses command.com. Ouch.) So there are no variables like %cd% or %~dp0.

You likely don't need them anyhow. But you do need to execute your batch file explicitly in IExpress like:

cmd.exe /c file.bat

so that it uses a modern command interpreter.

The second bit of code in your question makes the files persistent (ie they won't be deleted after the IExpress archive terminates) by xcopying them to a different directory.

like image 132
fission Avatar answered Oct 12 '22 12:10

fission


Here is what it means:

1) Creates a directory(MKDIR) with name of "UNIQUE PRODUCT NAME" in the path stored in %TMP% Environment Variable, which normally points to: C:\DOCUME~1\yourusername\LOCALS~1\Temp

MKDIR %Tmp%\<UNIQUE PRODUCT NAME>

2) Then copy recursively all installation files from current folder into the new folder created before. XCOPY arguments:

/S Copies directories and subdirectories except empty ones.

/E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.

/Y Suppresses prompting to confirm you want to overwrite an existing destination file.

XCOPY . %Tmp%\<UNIQUE PRODUCT NAME> /S /E /Y

3) Finally execute the application from the new location %Tmp%\\setup.exe

Hope this helps

like image 43
Adolfo Perez Avatar answered Oct 12 '22 11:10

Adolfo Perez