TC+AskParam.exe:How to pass current drive letter to askparam

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
seb-
Senior Member
Senior Member
Posts: 276
Joined: 2011-11-15, 06:14 UTC
Location: DE\BN - only part time TC user after switching to Linux ;)

TC+AskParam.exe:How to pass current drive letter to askparam

Post by *seb- »

Hi all,

i use TrueCrypt Containers for secure FileTransfer (usb stick usually).

I created 3 Custom Menu Entries in the Start-Menu of TC which are

TC Mount - uses AskParam to query for the DriveLetter to use and to query the Container Password

TC Dismount - uses AskParam to query for the DriveLetter of the mounted container that shall be dismounted

and TC Dismount all - doesnt use AskParam



My TC Dismount currently looks like

Code: Select all

%COMMANDER_PATH%\AskParam.exe

 /c"Drive to dismount" /p"Drive"   "%COMMANDER_PATH%\..\TrueCrypt\TrueCrypt.exe"  /s /a  /d "%%002" /q 


In http://ghisler.ch/board/viewtopic.php?t=17908&highlight=drive+parameter i read that it is possible to get the current drive letter as Parameter (i didn't find anything in the help file of TC) using

%%CD:~0,1%%

However, if i modify my parameter list as follows

Code: Select all

/c"Drive to dismount" /t"%%CD:~0,1%%" /p"Drive"   "%COMMANDER_PATH%\..\TrueCrypt\TrueCrypt.exe"  /s /a  /d "%%002" /q 
TC doesnt really parse the %%CD:~0,1%%, which i thougt should represent the current drive.

Anyone knows how to achieve my goal?

TLDR: how to pass the drive letter of the current openend directory to AskParam.exe?[/code]

Thanks in advance for any suggestions!
seb-
User avatar
MVV
Power Member
Power Member
Posts: 8713
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Unfortunately %CD:~0,1% is an internal cmd.exe's extension, it is not supported in other places. You can however call AskParam from cmd.exe to get it working:

Code: Select all

Command: cmd.exe /c start "" "%COMMANDER_PATH%\AskParam.exe"
Parameters: /c"Drive to dismount" /t"%%CD:~0,1%%" /p"Enter drive letter:" "%COMMANDER_PATH%\..\TrueCrypt\TrueCrypt.exe" /s /a /d "%%001" /q
Path: EMPTY!
Minimized: Yes
It seems that there is no way to get drive letter from TC directly.
seb-
Senior Member
Senior Member
Posts: 276
Joined: 2011-11-15, 06:14 UTC
Location: DE\BN - only part time TC user after switching to Linux ;)

Post by *seb- »

MVV wrote: You can however call AskParam from cmd.exe to get it working. (...)

It seems that there is no way to get drive letter from TC directly.
Thanks. This does the job just as i want it.

Maybe Christian can consider Drive Letter as a Parameter for later Versions.
There is so many parameters to use (in button bar as well) which are documented in the Helpfile that one additional Parameter for the drive letter wouldn't do any bad, would it? :-)

Thanks again MVV!
Post Reply