使用args启动进程,其中包含具有空格的路径 [英] Start process with args which contains a path with blanks
本文介绍了使用args启动进程,其中包含具有空格的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要从powershell脚本启动一个进程,并传递这样的参数:
-a -s f1d:\some目录\在路径\file.iss
中有空格我写了下面的代码:
I need to start a process from a powershell script and pass such params : -a -s f1d:\some directory\with blanks in a path\file.iss to do that, I write the folowing code :
$process = [System.Diagnostics.Process]::Start("$setupFilePath", '-a -s -f1"d:\some directory\with blanks in a path\fileVCCS.iss"')
$process.WaitForExit()
作为结果,进程开始,但最后一个参数:-f1d:\some directory\在路径中为空\file.iss
没有正确传递。帮助,请
as a result the process starts but the last argument : -f1d:\some directory\with blanks in a path\file.iss is not passing correctly. Help, please
推荐答案
我想你可以使用 Start-Process
Start-Process -FilePath $setupFilePath -ArgumentList '-a','-s','-f1"d:\some directory\with blanks in a path\fileVCCS.iss"' |
Wait-Process
这篇关于使用args启动进程,其中包含具有空格的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文