[英]Variable %ProgramFiles(x86)% not set or returned as expected from batch file
[英]How Do You Launch IIS Express From the Command Line Looking at ProgramFiles (x86)?
基本上这就是问题。 我尝试了几种选择:
iisexpress /path:"C:\ProgramFiles (x86)\PathToMyApp" /port:9000
iisexpress "/path:C:\ProgramFiles (x86)\PathToMyApp" /port:9000
iisexpress /path:C:\ProgramFiles^ ^(x86^)\PathToMyApp /port:9000
iisexpress "/path:C:\ProgramFiles (x86)\PathToMyApp" /port:9000
iisexpress /path:C:\ProgramFiles%20(x86)\PathToMyApp /port:9000
可能还有一些我刚才忘记的东西。 通常,该命令只是退出而不会说什么。 通过一些选择,我得到:
The term 'x86' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:38
+ .\iisexpress /path:%ProgramFiles (x86 <<<< )%\PathToMyApp /port:9000
+ CategoryInfo : ObjectNotFound: (x86:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
正确的方法是什么?
我没有对此进行测试,但是您是否尝试在程序和文件之间放置空格?
iisexpress /path:"C:\Program Files (x86)\PathToMyApp" /port:9000
Hysh_00最有可能用Program Files中的空格击中头部,但我认为某些语言会删除该空格。
在PowerShell 3.0中,您可以对此类命令使用停止解析符号,以阻止PowerShell插入命令行。
iisexpress --% /path:"C:\Program Files (x86)\PathToMyApp" /port:9000
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.