从vb.net运行DOS命令 [英] Running DOS command from vb.net
本文介绍了从vb.net运行DOS命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想从vb.net代码运行以下命令。当我把它放在process.start()
时它会返回语法错误。请指教
Hi,
I want to run the following command from vb.net code. When I put it in process.start(" ")
it returns syntax error. Please advise
E:\UnInstall\SQLServer\SQLServerExpress2008\SQLEXPR_x64_ENU.exe / SQ/SAPWD="testpwd123"/security=SQL/BROWSERSVCSTARTUPTYPE="Enabled"/TCPENABLED="1"/NPENABLED="0"/INDICATEPROGRESS="True"/INSTANCENAME="CBEInstance"/IACCEPTSQLSERVERLICENSETERMS="True"
谢谢
Thanks
推荐答案
process.start有一些参数,你应该将可执行文件的路径放在一个,然后在参数参数,你添加其他部分,例如:
The process.start has a few arguments, you should put the path to the executable in one, then in the arguments argument, you add the other pieces, like:
Process.Start(@"E:\UnInstall\SQLServer\SQLServerExpress2008\SQLEXPR_x64_ENU.exe", "SQ/SAPWD=\"testpwd123\"/security=SQL/BROWSERSVCSTARTUPTYPE=\"Enabled\"/TCPENABLED=\"1\"/NPENABLED=\"0\"/INDICATEPROGRESS=\"True\"/INSTANCENAME=\"CBEInstance\"/IACCEPTSQLSERVERLICENSETERMS=\"True\"");
有关流程的MSDN文档。开始 [ ^ ]
你可以使用shell函数。
shell函数可以用如下。
you can use shell function .
shell function can be used as following.
dim mycommand as string=""
mycommand="ipconfig"
Shell(bk_cmd, AppWinStyle.MaximizedFocus, True)
详细信息,>
http:/ /msdn.microsoft.com/en-us/library/xe736fyk%28v=vs.71%29.aspx [ ^ ]
这篇关于从vb.net运行DOS命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文