Problems with trailing backslashes

Bugs and issues - current donor version.
Post Reply
Posts: 22
Joined: 30.03.2009, 08:37

Problems with trailing backslashes

#1 Post by catweazle9 » 06.10.2012, 16:11

If I invoke FreeCommander from the command line as follows:

FreeCommander.exe /C /T /R=C:\Windows\

.. the folder is displayed in the right pane (as expected), but pressing Backspace (or clicking the two dots) to move up a folder has no effect.

It would be very helpful if FreeCommand could strip any trailing backslashes from the path and allow this to work. I have an External Command defined in Visual Studio which launches FreeCommander to display the folder of the current file I'm editing. The Visual Studio settings to configure the external command are:

Title: FreeCommander
Command: C:\Program Files\FreeCommander\FreeCommander.exe
Arguments: /C /T "/R=$(ItemDir)"
Initial Directory: <blank>
.. with all checkboxes unticked.

Unfortunately, the $(ItemDir) path includes the trailing backslash (sometimes two backslashes, I think).

As a workaround I've configured the Visual Studio external command to invoke the bat file below, but it triggers an ugly command prompt window and seems clunky.


--- John.

REM Triggers FreeCommanderXE to display the given directory, after first stripping any trailing slash
REM If the slash is left intact then Backspace (up directory) doesn't work.
REM Remove quotes from the argument - ... batch.aspx
set dirpath=%~1

if "%dirpath%" == "" exit

REM Remove trailing slash - ... file-input
if %dirpath:~-1%==\ set dirpath=%dirpath:~0,-1%
REM Do it again as the $(ItemDir) argument from Visual Studio oddly has 2 trailing backslashes
if %dirpath:~-1%==\ set dirpath=%dirpath:~0,-1%

echo %dirpath%

"C:\Program Files (x86)\FreeCommander XE\FreeCommander.exe" /C /T /R=%dirpath%

Posts: 2832
Joined: 10.04.2006, 07:48
Location: Germany

Re: Problems with trailing backslashes

#2 Post by Marek » 08.10.2012, 20:16

Fixed for the release 602.

Post Reply

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 4 guests