在Shell方法中执行命令提示 [英] Execute Command prompt in Shell method
问题描述
我的目标可执行文件位置是``C:\ Documents and Settings \ Administrator \ Desktop \ MSI Installer \ Dependency Setup \ SQL Setup \ x86 \ setup''&文件名是``setupsql.exe''
我想通过创建位于.C:\ Documents and Settings \ Administrator \ Desktop \ MSI Installer \ Dependency Setup \ SQL Setup \ Unatted File \ setup.iss''中的.iss文件以静默方式安装SQL Server.
直接在命令提示符下运行即可(例如c:\>)
重新启动后,m/c&从控制面板&卸载MS SQL Server从c:\ Programs中的MS SQL SERVER文件夹中删除,exe文件和.iss文件上方的文件通过vb.net编码运行,显示错误msg.消息为在命令行参数中指定的路径无效:C:\ Documents and Settings \ Administrator \ Desktop \ MSI Installer \ Dependency Setup \ SQL Setup \ x86 \ setup \ setup.iss"
我的代码如下:
-----------------
My target executable file location is ''C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\x86\setup'' & Filename is ''setupsql.exe''
I want to do that SQL Server is install in silent mode through creating .iss file which located in ''C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\Unatteded File\setup.iss''
Directly, it is proper run through command prompt(i.e. c:\>)
After the restart the m/c & uninstall MS SQL server from control panel & delete from MS SQL SERVER folder in c:\Programs, those above exe file and .iss file is run through vb.net coding, it is error msg shown. Msg is ''The path specified in command line argument is invalid: C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\x86\setup\setup.iss''
My code is below :
-----------------
Dim filePathArg As String = "C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\x86\setup\setupsql.exe -s -fl ""C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\Unattended File\setup.iss"""
Shell(filePathArg, AppWinStyle.Hide)
我将如何通过编码解决上述问题?
请帮助我,这对我来说非常重要....
How will i solve the above problem through coding?????
Please help me,it''s a very impotant to me....
推荐答案
您需要用引号将所有文件名引起来.否则,shell将执行第一个空格之前的所有内容.尝试这样的事情:
You need to surround all the filenames with quotes. The shell will otherwise execute whatever is before the first space. Try something like this:
Dim filePathArg As String = """C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\x86\setup\setupsql.exe"" -s -fl ""C:\Documents and Settings\Administrator\Desktop\MSI Installer\Dependency Setup\SQL Setup\Unattended File\setup.iss"""
祝你好运!
Good luck!
这篇关于在Shell方法中执行命令提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!