Environment variables - path to USB drive

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
joeyeti
Junior Member
Junior Member
Posts: 53
Joined: 2004-04-15, 10:17 UTC

Environment variables - path to USB drive

Post by *joeyeti »

Hi,

could somebody help me with pointing to USB drive from TotalCommander? Is there an environment variable for USB drives - eg %something%?

How can I point to the USB drive?

Joe Yeti
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

If you want access the USB-Drive where you TC Installation resides you cann point to this program dir with %Commander_path% as soon as TC is started.

If you think of something else you should explain a bit more in detail what for you need to access the USB Drive. Maybe someone has an idea how to realize.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
joeyeti
Junior Member
Junior Member
Posts: 53
Joined: 2004-04-15, 10:17 UTC

Post by *joeyeti »

I have Total Commander on USB in a subdir, not in the root dir of the USB...

But I am referring to adding a shortcut on Toolbar for an App and setting the path to relative (to the USB - on which this App resides).... So that I am able to run this Toolbar Shortcut whether the USB is F:\, X:\ or D:\......

Example:

I have say Notepadplus.exe in %USB%\Install\Notepad\

What would be the relative path for this App?

Thx.

Joe Yeti
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Lets say your Totalcmdexe is in f:\totalcmd\totalcmd.exe then the path to your App should be:

Code: Select all

%Commander_path%\..\install\notepad.exe
or when the path is f:\program files\totalcmd\totalcmd.exe then you must use:

Code: Select all

%Commander_path%\..\..\install\notepad.exe
Hope that helps.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
joeyeti
Junior Member
Junior Member
Posts: 53
Joined: 2004-04-15, 10:17 UTC

Post by *joeyeti »

Yea, great.

It works!

Thx to you both...

Anyway, if somebody would know, if in Windows a USB identifier variable exists (like %CDROM% or so), please post it here (although it is little offtopic :) )

Joe Yeti
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

joeyeti wrote:Y
Thx to you both...
Oh you already know that UI'm multiple ;) :lol:

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
joeyeti
Junior Member
Junior Member
Posts: 53
Joined: 2004-04-15, 10:17 UTC

Post by *joeyeti »

:D Why did I think there were two people answering me????? Hmmmm?????????

:roll: :lol: :shock:
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

There is no %USB% simply because there can be more than one USB drive at the same time! For example, one of my USB harddisks has 4 partitions, and shows up with 4 drive letters when plugged in...
Author of Total Commander
https://www.ghisler.com
User avatar
Hacker
Moderator
Moderator
Posts: 13067
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Christian,
Could there be a %COMMANDER_DRIVE% (eg F:\) variable in 7.0 as has been requested in the past? It would solve these ..\..\..\..\ workarounds.

TIA
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Could there be a %COMMANDER_DRIVE% (eg F:\) variable in 7.0 as has been requested in the past? It would solve these ..\..\..\..\ workarounds.

Uuuuhh, yes please sir , yes please sir. ;) :lol:

support++

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Good idea, I will add it to my to do list for TC 7 (that's higher priority than wish list).
Author of Total Commander
https://www.ghisler.com
Tsunulukai
Junior Member
Junior Member
Posts: 66
Joined: 2003-02-07, 23:44 UTC

Post by *Tsunulukai »

Could you also consider adding a related command line parameter option for the "/L" or "/R" Switch that could point to that drive ?

Code: Select all

Eg : totalcmd.exe /L:%COMMANDER_DRIVE%
This one might not work as the %commander_drive% is not set untill TC is started... But something similar would be very nice !

Code: Select all

totalcmd.exe /L:!COMMANDER_DRIVE
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3299
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

Tsunulukai wrote:Could you also consider adding a related command line parameter option for the "/L" or "/R" Switch that could point to that drive ?

Code: Select all

Eg : totalcmd.exe /L:%COMMANDER_DRIVE%
This one might not work as the %commander_drive% is not set untill TC is started...
as your above code starts TC ur code would work.
Proof: Windows+R, <path to tc>totalcmd.exe /L:%Commander_Path%<enter> :D
Hoecker sie sind raus!
Tsunulukai
Junior Member
Junior Member
Posts: 66
Joined: 2003-02-07, 23:44 UTC

Post by *Tsunulukai »

Are you sure the variable %xxx% is not remplaced by its value before system starts the program ? If not, then your right... But if it is... It won't work
User avatar
Sheepdog
Power Member
Power Member
Posts: 5150
Joined: 2003-12-18, 21:44 UTC
Location: Berlin, Germany
Contact:

Post by *Sheepdog »

Tsunulukai wrote:Are you sure the variable %xxx% is not remplaced by its value before system starts the program ? If not, then your right... But if it is... It won't work
Yes.

sheepdog
"A common mistake that people make when trying to design something
completely foolproof is to underestimate the ingenuity of complete fools."
Douglas Adams
Post Reply