加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

如何使用参数在Inno Setup中运行.exe文件

发布时间:2020-12-15 09:17:30 所属栏目:大数据 来源:网络整理
导读:请尝试运行cmd控制台中运行的.exe文件,方法如下: nameFile.exe -inf fileDriver.inf install 在Inno Setup中我有以下内容: varcommand: Srtring;Begincommand := 'nameFile.exe -inf fileDriver.inf install';command := AddQuotes(command);Exec(command,
请尝试运行cmd控制台中运行的.exe文件,方法如下:

nameFile.exe -inf fileDriver.inf install

在Inno Setup中我有以下内容:

var
command: Srtring;

Begin

command := 'nameFile.exe -inf fileDriver.inf install';
command := AddQuotes(command);
Exec(command,'','C:pathOfFileName',SW_SHOWNORMAL,ewWaitUntilTerminated,ResultCode);
S:= SysErrorMessage(ResultCode);
MsgBox(S,mbInformation,MB_OK);
end;

消息显示参数无效,如何用参数运行exe文件?

解决方法

查看 Exec调用,需要将命令参数传递给函数调用的第二个参数.尝试使用类似的东西:

...
Exec('nameFile.exe','-inf fileDriver.inf install',ResultCode);
...

Exec函数声明为:

function Exec(const Filename,Params,WorkingDir: String; 
  const ShowCmd: Integer; const Wait: TExecWait; 
  var ResultCode: Integer): Boolean;

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读