vb.net 如何启动带参数的exe
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12684915/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to start up an exe with parameters
提问by user1713546
I am new to Visual Basic. I am using VB Premium 2012.
Is there a way I can open/start up an exe
file (not my app) with params. I know we can do it in batch coding using echo
and stuff. Can it be done in vb?
我是 Visual Basic 的新手。我正在使用 VB Premium 2012。有没有一种方法可以使用参数打开/启动exe
文件(不是我的应用程序)。我知道我们可以使用echo
和东西在批量编码中做到这一点。可以用vb做吗?
I want to open up "app.exe
" with params as "-login usernamehere passwordhere
"
我想打开“ app.exe
”,参数为“ -login usernamehere passwordhere
”
回答by Nigel Findlater
Try this
尝试这个
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)
I hope this helps...
我希望这有帮助...