Page 1 of 1

Favorite tools issue with files/folders with spaces

Posted: 05.01.2020, 05:19
by zbernie
I have a favorite tools item named "Combine Images Horizontally" which takes highlighted image files and combines them horizontally. It executes a powershell wrapper script around ImageMagic. It works fine EXCEPT when the files contain spaces. I've tried quoting some of the parameters such as "%ActiveDir"" and %ActiveSelName%", and numerous other quoting syntax, to no avail. Listed below is the favorite tool I'm referring to. This is using FC 810 donor version.

Any suggestion to get this working would be greatly appreciated.


Program or folder:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Start folder:
%ActivDir%

Parameter:
C:\Users\bernie\PowerShell\im-combine-images-horizontally.ps1 %ActivSelName%

, Delimiter character for selected items

Checked Enclose each item with "

Re: Favorite tools issue with files/folders with spaces

Posted: 06.01.2020, 18:58
by Marek
Try to add the %Dlg% parameters:
C:\Users\bernie\PowerShell\im-combine-images-horizontally.ps1 %ActivSelName% %Dlg%

Then you can see in the dialog how FreeCommander will start the favorite.
We do not know what you have in the script, you must know if the parameters are OK or not.

Re: Favorite tools issue with files/folders with spaces

Posted: 07.01.2020, 02:57
by zbernie
Thanks, I've used the %Dlg% which is very useful. The problem is the bizarre Windows quoting necessary for files/folders containing spaces. I found the two quoting methods below work from the command line. I'm going to try and duplicate this in FreeCommander.

PS C:\Users\bfbarton\Powershell> C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe C:\Users\bernie\Powershell\test2.ps1 "'Infosec1.PNG', 'Infosec2.PNG', 'WriteFile - Copy.ps1'"

PS C:\Users\bfbarton\Powershell> cmd /S /C powershell "C:\Users\bernie\Powershell\test2.ps1 'Infosec1.PNG, Infosec2.PN
, WriteFile` -` Copy.ps1'"