Script fails when spaces in path name

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
zBernie
Posts: 181
Joined: 08 Dec 2016 17:20

Script fails when spaces in path name

Post by zBernie »

The script below bombs if I run it in a directory that contains spaces. How can I handle spaces in the path name?

$var_file = "<selitems ,>";
runret("D:\Program Files\ImageMagick-7.0.3-Q16\convert.exe $var_file +append merged-horizontal.jpg");

highend
Posts: 15004
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Script fails when spaces in path name

Post by highend »

And since when does convert.exe accept comma-delimited input files?

Code: Select all

    $var_files = get("SelectedItemsPathNames", '" "');
    runret("""D:\Program Files\ImageMagick-7.0.3-Q16\convert.exe"" ""$var_files"" +append merged-horizontal.jpg");
One of my scripts helped you out? Please donate via Paypal

zBernie
Posts: 181
Joined: 08 Dec 2016 17:20

Re: Script fails when spaces in path name

Post by zBernie »

Evidently dealing with a comma separated list of file names will be another issue.

I just want to pass a script file names as arguments, XYPlorer makes that difficult. There are several threads in this forum regarding passing a PowerShell script parameters, which was never resolved.

-Thanks

Post Reply