' Reload TC with return to different directories types
' and open archives
' Requirements: Script Helper ActiveX for TC by Volniy
' Parameters: "%X%P%Z" "%T"
' Flasher (c)
'=================================
LP = WScript.Arguments(0)
RP = WScript.Arguments(1)
With CreateObject("TCScript.Helper")
.SendCommand "cm_ConfigSaveDirHistory"
L = Replace(.INIRead(.MainINI, "LeftHistory", "0", ""), "/", "\")
R = Replace(.INIRead(.MainINI, "RightHistory", "0", ""), "/", "\")
.SendCommand "cm_Exit", True
End With
LM = Left(L, Len(L)-(Len(LP)-1))
RM = Left(R, Len(R)-(Len(RP)-1))
Dim ListL, ListR, NameArr, N, Param, TCexe
Set ListL = CreateObject("Scripting.Dictionary")
Set ListR = CreateObject("Scripting.Dictionary")
NameArr = Array(&Ha, &H3, &H4, &H11, &H12)
With CreateObject("Shell.Application")
For Each N In NameArr
ListL.Add .NameSpace(N).Self.Path & "|" & LP , ""
ListR.Add .NameSpace(N).Self.Path & "|" & RP , ""
Next
End With
If L="::|"&LP And ListR.Exists(R) Then
Param = "/L=""" & L & """ /R=""" & RM & """"
ElseIf ListL.Exists(L) And R="::|"&RP Then
Param = "/L=""" & LM & """ /R=""" & R & """"
ElseIf ListL.Exists(L) And ListR.Exists(R) Then
Param = "/L=""" & LM & """ /R=""" & RM & """"
ElseIf ListL.Exists(L) Then
Param = "/R=""" & R & """ /L=""" & LM & """"
ElseIf ListR.Exists(R) Then
Param = "/L=""" & L & """ /R=""" & RM & """"
Else
Param = "/L=""" & L & """ /R=""" & R & """"
End If
TCexe = "%Commander_Path%\totalcmd.exe"
With CreateObject("WScript.Shell")
.Run """" & .ExpandEnvironmentStrings(TCexe) & """ " & Param, 0
End With
WScript.Quit |