I have the following script:
Code: Select all
foreach($item, <get selecteditemspathnames>, <crlf>, , "No files selected!") {
$file_path = getpathcomponent($item, "path");
$file_base = getpathcomponent($item, "base");
run "cmd /k ""c:\Program Files\GDAL\gdalwarp.exe"" -te -1611382 -3930115 -1176482 -3443415 -tr 100 100 ""$item"" ""$file_path\$file_base" . "_resampled_100m.tif""", , 1, 1;
}
which just shells out a command to execute on selected files. It didn't work and the cmd.exe window just flashed so I couldn't see any error message. So I added the cmd /k in the front, and what I see is ''c:\Program' is not recognized as an internal or external command, operable program or batch file.' But I am escaping the path to the executable. I tried doubling up on the escaping and not escaping at all but neither worked. So what am I missing here?