首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >带有参数的Setup.exe ( VB.NET )

带有参数的Setup.exe ( VB.NET )
EN

Stack Overflow用户
提问于 2015-08-08 02:43:30
回答 1查看 2.1K关注 0票数 0

我不知道如何用任何参数开始setup.exe

实际上,尝试一下这段代码,但是有些地方出错了:

代码语言:javascript
运行
复制
Dim p As New ProcessStartInfo
p.FileName = Application.StartupPath & "\Content\Office\2013_ALL\x86\setup.exe"
p.Arguments = Application.StartupPath & "\Content\Office\2013_ALL\x86\setup.exe" & "/configure .\365HomePrem86.xml"
p.WindowStyle = ProcessWindowStyle.Normal
Process.Start(p)

如果你有办法解决这个问题,请告诉我!

我希望像这样启动setup.exe (.bat文件):

代码语言:javascript
运行
复制
start setup.exe /configure .\365HomePrem86.xml
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-08-08 03:02:57

试试下面的。您不需要参数() setup.exe的完整路径,property...just给它参数。有时,还需要设置WorkingDirectory()才能使应用程序正常工作:

代码语言:javascript
运行
复制
    Dim p As New ProcessStartInfo
    p.FileName = Application.StartupPath & "\Content\Office\2013_ALL\x86\setup.exe"
    p.WorkingDirectory = System.IO.Path.GetDirectoryName(p.FileName)
    p.Arguments = "/configure .\365HomePrem86.xml"
    p.WindowStyle = ProcessWindowStyle.Normal
    Process.Start(p)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31889105

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档