带有VB.NET参数的Setup.exe

时间:2015-08-08 02:43:31

标签: vb.net processstartinfo

我不知道如何用任何参数启动setup.exe

实际上尝试使用此代码但出现问题:

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文件):

start setup.exe /configure .\365HomePrem86.xml

1 个答案:

答案 0 :(得分:0)

尝试以下方法。你不需要Arguments()属性中setup.exe的完整路径......只需给它参数。有时您还需要设置WorkingDirectory()以使应用程序正常工作:

    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)