创建IExpress的批处理文件 [英] Create Batch file for iexpress

查看:219
本文介绍了创建IExpress的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用的IExpress 运行我的批处理文件,该文件将执行2 EXE&安培; 1 MSI文件给我。当我尝试做手工,它的工作原理。

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" 

但这似乎并没有工作,当我创建的IExpress一个exe文件。

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

< A HREF =htt​​p://www.itscodingtime.com/post/Combine-Setup-MSI-and-EXE-into-a-single-package-with-IExpress.aspx相对=nofollow>参考

上面提到的文章有一些代码(将文件复制到临时文件夹)及。但我不能够理解语法

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


推荐答案

的问题是,因为你可以从截图中看到,该批处理文件正在被执行 command.com ,而不是的cmd.exe 。 (如果你不指定一个解释,IExpress程序使用 command.com 。哎哟。)所以有喜欢%CD%没有变量%〜DP0

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.

您可能并不需要他们无论如何。但是,你需要以明确的IExpress执行批处理文件,如:

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.

在你的问题的代码的第二位通过 XCOPY 使得持续性的文件(即它们不会IExpress程序存档后删除终止)ING他们到不同的目录。

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.

这篇关于创建IExpress的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆