Enclose the target script path in quotes

This commit is contained in:
CorpNewt
2024-06-12 06:48:24 -05:00
committed by GitHub
parent 150e3bd23a
commit 841d9f6487
+1 -1
View File
@@ -43,7 +43,7 @@ if not "!_args!" == "" (
REM And our target
call :cleanArg "_target"
REM Let's build our command
powershell -c "& {$a=@();foreach($x in $args){foreach($y in (Invoke-Expression('Write-Output -- '+$x-replace'\$',\"`0\"))-replace\"`0\",'$$'){$a+='\"{0}\"'-f$y}};$c=$a-join' ';$d='/c \"{0}\"'-f$c;Start-Process '%COMSPEC:'=''%' -WindowStyle hidden -ArgumentList $d}" '!_target!!_args!'
powershell -c "& {$a=@();foreach($x in $args){foreach($y in (Invoke-Expression('Write-Output -- '+$x-replace'\$',\"`0\"))-replace\"`0\",'$$'){$a+='\"{0}\"'-f$y}};$c=$a-join' ';$d='/c \"{0}\"'-f$c;Start-Process '%COMSPEC:'=''%' -WindowStyle hidden -ArgumentList $d}" '\"!_target!\"!_args!'
endlocal
exit /b