小编cod*_*ero的帖子

您如何将“程序文件(x86)”传递给 Powershell?

我已经阅读并尝试了各种方法,但它就是不接受......我什至试图逃避空格以及试图在路径前添加额外的引号(转义引号)......

$cmd = 'powershell.exe'
$dir = 'C:\Program Files (x86)\W T F'
$inner = "-NoExit -Command cd $dir"
$arguments = "Start-Process powershell -ArgumentList '$inner' -Verb RunAs"
& $cmd $arguments
Run Code Online (Sandbox Code Playgroud)

它不断给我这个:

x86 : 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:22
+ cd C:\Program Files (x86)\W T F …
Run Code Online (Sandbox Code Playgroud)

powershell

11
推荐指数
1
解决办法
5万
查看次数

标签 统计

powershell ×1