$(FullPathRight)

Discussion of bugs and problems found in Altap Salamander. In your reports, please be as descriptive as possible, and report one incident per report. Do not post crash reports here, send us the generated bug report by email instead, please.
skwoz

$(FullPathRight)

Post by skwoz »

I have a simple problem. I do have a difference tool wich takes direkctories as arguments. It cannot swallow directories ending with
"\". If I need to compare "C:\Prgram Files" with "D:\Program Files" and I use customizeed user menu it makes something like:
diff "C:\Prgram Files\" "D:\Program Files\"
How can I omit the "\" at the end of each argument???

Thanx
Frank
User avatar
th.
Posts: 116
Joined: 04 Sep 2006, 23:09
Location: Germany

Post by th. »

Here's a little VBScript to get rid of the trailing "\":

Code: Select all

Set objArgs = WScript.Arguments
Verz1=objArgs(0)
if right(Verz1,1)="\" and right(Verz1,2)<>":\" then Verz1=left(Verz1,len(Verz1)-1)
Verz2=objArgs(1)
if right(Verz2,1)="\" and right(Verz2,2)<>":\" then Verz2=left(Verz2,len(Verz2)-1)
Set sh = WScript.CreateObject("WScript.Shell")
sh.Run "diff """ & Verz1 & """ """ & Verz2 & """"
Save it as e.g. diff.vbs and use it in AS as the user menu command.
Set the path to your compare tool in the last line according to your needs.

Thomas
Jan Rysavy
ALTAP Staff
ALTAP Staff
Posts: 5231
Joined: 08 Dec 2005, 06:34
Location: Novy Bor, Czech Republic
Contact:

Post by Jan Rysavy »

NICE!
Guest

Post by Guest »

You can replace:
if right(Verz1,1)="\" and right(Verz1,2)<>":\" then and
if right(Verz2,1)="\" and right(Verz2,2)<>":\" then

with:
If Verz1 Like "*[!:]\" Then and
If Verz2 Like "*[!:]\" Then

to make it faster.
User avatar
SvA
Posts: 483
Joined: 29 Mar 2006, 02:41
Location: DE

Post by SvA »

You may try to add a dot at the end of the path and forget about the script.
i.e "$(FullPathRight)." to get "D:\Program Files\."
skwoz

Post by skwoz »

Thanx a lot for the dot-tip! Perfect! It works perfectly
Post Reply