如何在以下电源shell脚本中转义间距?我试过`,^甚至双引号括起文件夹名称的间距,但仍然命中目录不存在。执行停止时“C:\ Users \ Super:”目录不存在
cmd /c C:\Users\Super Human\.nuget\packages\google.protobuf.tools\3.5.1\tools\windows_x64\protoc.exe -I C:\Users\Super Human\Desktop\School Service\School.Service.Student\Grpc\Protobuf\proto\exception\ -I ...
答案 0 :(得分:0)
$dq=$([char]34)
$CommandLine=-join (
$dq,
'C:\Users\Super Human\.nuget\packages\google.protobuf.tools\3.5.1\tools\windows_x64\protoc.exe',
$dq,
' -I ',
$dq,
'C:\Users\Super Human\Desktop\School Service\School.Service.Student\Grpc\Protobuf\proto\exception\',
$dq,
' -I '
)
cmd.exe /c $CommandLine