如何使用参数启动exe

时间:2012-10-02 05:17:46

标签: vb.net exec parameter-passing

我是Visual Basic的新手。我正在使用VB Premium 2012。 有没有办法用params打开/启动exe文件(不是我的应用程序)。我知道我们可以使用echo和东西进行批量编码。可以在vb中完成吗?

我想打开“app.exe”,其中params为“-login usernamehere passwordhere

1 个答案:

答案 0 :(得分:7)

试试这个

Dim pHelp As New ProcessStartInfo
pHelp.FileName = "YourApplication.exe"
pHelp.Arguments = "parameter1,parameter2"
pHelp.UseShellExecute = True
pHelp.WindowStyle = ProcessWindowStyle.Normal
Dim proc As Process = Process.Start(pHelp)

我希望这会有所帮助......