Favorite tools issue with files/folders with spaces

Discussion and questions - donor version.
Post Reply
Message
Author
zbernie
Posts: 28
Joined: 02.01.2020, 15:39

Favorite tools issue with files/folders with spaces

#1 Post by zbernie » 05.01.2020, 05:19

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 "

Marek
Author
Author
Posts: 2685
Joined: 10.04.2006, 07:48
Location: Germany
Contact:

Re: Favorite tools issue with files/folders with spaces

#2 Post by Marek » 06.01.2020, 18:58

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.

zbernie
Posts: 28
Joined: 02.01.2020, 15:39

Re: Favorite tools issue with files/folders with spaces

#3 Post by zbernie » 07.01.2020, 02:57

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'"

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests