Using TotalCommander on an usb-stick-drive

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Chatme
Junior Member
Junior Member
Posts: 11
Joined: 2003-02-06, 12:20 UTC
Location: Germany - Hamburg

Using TotalCommander on an usb-stick-drive

Post by *Chatme »

Hi,
i'm an owner of a usb-stick-drive since November 2002 and a registered user of totalcommander for many years.
Now i want to carry my totcmd on my usb-stick-drive, but on every computer i stick in my usb-drive it get another drive-letter. So i get several problems lying in the *.ini (wincmd and wcx_ftp) and in starting the totcmd.exe, because the programm searchs the ini's in the win-directory.
I can change most of the ini-lines with a relative directory but how to start the totcmd telling him the path to the ini's?
The only way for me seems to start the totcmd.exe with parameters, but when i go this way i have to use an absolute path to the ini's.

Any ideas ?

Greetings ChatMe
User avatar
Maxwish
Senior Member
Senior Member
Posts: 370
Joined: 2003-02-05, 19:13 UTC
Location: .NL

Post by *Maxwish »

Use a BAT file in you totalcmd dir with the following line to start TC:

Code: Select all

TOTALCMD.EXE /I=.\wincmd.ini /F=.\wcx_ftp.ini
The ini files will now be read in your tc dir. See the "About Total Commander" to verify the right location of the ini files.
[BTW: If the DOS window from the bat file remains visible after you start TotalCmd, you might want to make a PIF file (alt-enter on the bat file) and check the "close on exit" button]

As you said, the plugins/packers/viewers can all be make relative by editing the ini. But I still have problems with getting the Button-bar and it's commands to work relative. Do you/anybody know how to do this ?
...BRB...
Chatme
Junior Member
Junior Member
Posts: 11
Joined: 2003-02-06, 12:20 UTC
Location: Germany - Hamburg

Post by *Chatme »

@MaxWish
Thanx for your help, it runs very well !!

Sorry, but i don't have a solution for your problem, but if Christian could implement a new parameter where the information of the totcmd-directory or totcmd-drive is (where this instance of totcmd runs on), it would be easy for you:

[face=courier]In the Startmenue...
command: relativ path to your application
parameter: if you need...
startpath: the new parameter, i.e. "%!"
[/face]
Greetings, ChatMe
batchman61
Junior Member
Junior Member
Posts: 43
Joined: 2003-02-07, 19:24 UTC
Location: Germany

Post by *batchman61 »

Hi,

if it's possible to set environment variable(s) to an appropriate value you are can use them for "relative" path names
Example: Program is stored in P:\program, configuration in M:\config
set PROGRAM=P:\PROGRAM
set CONFIG=M:\CONFIG
Create a lnk or bat like %PROGRAM%\totalcmd.exe /I=%CONFIG%\wincmd.ini /F=%CONFIG%\wcx_ftp.ini

You can use the same within wincmd.ini and the button bars. As far as i know the only possible problem is a name conflict with the standard file/dir placeholders of tc
(i had problems in wincmd.ini [Configuration] Mainmenu=%USRCONFIG%\...)

Methods to work around the changing drive letter had been discussed in the old forum times. Users suggested batch files like
if exists D:\TOTALCMD set DRV=D:
if exists E:\TOTALCMD set DRV=E:
...
or to use subst to assign a drive letter to a directory

Bart Lagerweij wrote a utility launch http://www.nu2.nu/launch/ which offers different placeholders for current dir etc. and can be very helpful

good luck!
User avatar
Maxwish
Senior Member
Senior Member
Posts: 370
Joined: 2003-02-05, 19:13 UTC
Location: .NL

Post by *Maxwish »

Yes, the SUBST command would be better.

Just did it on my PC and it works very nice. And is much easier to configure because you don't have to change the ini file by hand.

Make a bat file to start TC containing:
subst T: .
TOTALCMD.EXE /I=T:\wincmd.ini /F=T:\wcx_ftp.ini


This will make a virtual drive T: that is linked to the real TC directory on your PC (no matter what the real drive/path is). Now using the normal TC configuration you can change all your plugins/butttonbars/packers etc to be run from the T drive.

[note about the "close on exit" in the PIF file: you would like to remove the path to the bat file in the CMD LINE box)
Last edited by Maxwish on 2003-02-28, 22:10 UTC, edited 1 time in total.
...BRB...
djek
Junior Member
Junior Member
Posts: 46
Joined: 2003-02-11, 14:07 UTC

Post by *djek »

My own solution is even worse.
I created an autIt executable (43K) that passes path-parameters to a batch file.
That batchfile runs a dosprogram (alter) which updates all ini and bar files.
It simply replaces all old path's with new path's, works very well.
Because of the driveletter is the real driveletter, I run an optional traymenu program (atray from the autit yahoogroup) so I can run my programs immediately.

I like the subst idea
Chatme
Junior Member
Junior Member
Posts: 11
Joined: 2003-02-06, 12:20 UTC
Location: Germany - Hamburg

Post by *Chatme »

thanx @all,
i tried to use the launch-program an it runs !! Subst and AutoIt are good solution, but i don't need more drives or an AutoIt-start-program (because it isn't as flexible as launch.exe).
I make a launch.ini contenting:
[face=courier][default]
program=@pdir@\tools\totalc~1\TOTALCMD.EXE /N /I=@pdir@\tools\totalc~1\wincmd.ini /F=@pdir@\tools\totalc~1\wcx_ftp.ini
show=3
[/face]
Thats the best way for me. Thank you all for your help and your very good ideas.
Greetings, ChatMe
Post Reply