使用 PowerShell 中的参数运行应用程序

Alb*_*bin 3 powershell windows-10

在 Win10 系统上,我想执行以下命令(取自工作快捷方式文件):

"C:\Path with spaces\application.exe" U=<username> S=serverName
Run Code Online (Sandbox Code Playgroud)

在 CMD 中,以下命令打开应用程序没有任何问题:

"C:\Path with spaces\application.exe" "U=<username>" "S=serverName"
Run Code Online (Sandbox Code Playgroud)

然而,在PowerShell中,我尝试了各种组合(例如,包括使用Start-Processcmd /c到目前为止它一直对我有用),但它们都失败了。这可能很简单,但我无法让它发挥作用。正确的记号是什么?

小智 5

Start-Process -FilePath "C:\Path with spaces\application.exe" -ArgumentList "U=<username> S=serverName"
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

2713 次

最近记录:

5 年,2 月 前