Running Veracrypt from TC results in missing drive

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
LittleBit
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-04, 19:52 UTC

Running Veracrypt from TC results in missing drive

Post by *LittleBit »

Im testing to run program Veracrypt.exe from a batchfile.
I'm using win 10 on a HP-laptop.

I created Test1.bat with content:
"C:\Program Files\VeraCrypt\veracrypt.exe" /l T: /v C:\database.dat /password 1234 /q
Goal is that Veracrypt mounts drive T:

When I run this batchfile from Command Prompt or from File Explorer or from Task Scheduler,
everything is fine
and the result is that Veracrypt mounts drive T: correctly.

But when I run this same batchfile from TotalCommander (tested v10 and v 9.51)
then -although drive-letter is free- the result is:
VeraCrypt-error-message: "Drive letter not available"

Any suggestions for impovement or extra tests ?
User avatar
Horst.Epp
Power Member
Power Member
Posts: 7012
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Running Veracrypt from TC results in missing drive

Post by *Horst.Epp »

I guess you are running TC with different rights than Explorer.
Drives are account dependent.
Windows 11 Home, Version 24H2 (OS Build 26100.4351)
TC 11.55 RC7 x64 / x86
Everything 1.5.0.1396a (x64), Everything Toolbar 1.5.5.0, Listary Pro 6.3.2.88
QAP 11.9.0.4 x64
LittleBit
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-04, 19:52 UTC

Re: Running Veracrypt from TC results in missing drive

Post by *LittleBit »

> guess you are running TC with different rights than Explorer.
No, I'm running both as the same user.

But your comment stimulated to do extra tests
and the problem I experience is only happing with my drives S:, T: and X:.
So it seems you are right and that there is a drive rights problem and not a TC-problem.

And yes, I have been wondering what is so special for the S:, T: and X:-drive
and I can tell you that in the past I have used those 3 drive-letters in Veracrypt to mount a drive.
So it seems that Veracrypt has created some drive settings in the past, perhaps a policy setting, that is currently preventing TC to run without problems.

Any suggestion how I can test what is causing my problem ?
Last edited by LittleBit on 2022-02-05, 02:42 UTC, edited 1 time in total.
User avatar
Dalai
Power Member
Power Member
Posts: 10023
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Running Veracrypt from TC results in missing drive

Post by *Dalai »

Running something as the same user doesn't guarantee that it gets the same rights/privileges. As long as the UAC is enabled, running some process as administrator, this process might run under the same user (but it might not) but it definitely is not running with the same rights or privileges. It's a different story with UAC disabled.

Long story short: If you run TC as administrator, the things you observed are perfectly normal. Drives S:, T: and X: might be used in the administrative context. If you don't run TC as admin, it may be worth investigating further what is causing this.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
LittleBit
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-04, 19:52 UTC

Re: Running Veracrypt from TC results in missing drive

Post by *LittleBit »

> If you run TC as administrator,
Done ! But same results.....
User avatar
nsp
Power Member
Power Member
Posts: 1949
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: Running Veracrypt from TC results in missing drive

Post by *nsp »

Have you made any network share inside TC which can already take those drive letters ?
What you can do is to use this small script to see if T drive is available.
Create a file AvailableDriveLeter.hta

Code: Select all

<!DOCTYPE html>
<html>
<SCRIPT Language="VBScript">
    Sub Window_onLoad
        strComputer = "."
        Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
        Set colDisks = objWMIService.ExecQuery("Select * from Win32_LogicalDisk")
        Set objDictionary = CreateObject("Scripting.Dictionary")

        For Each objDisk in colDisks
            objDictionary.Add objDisk.DeviceID, objDisk.DeviceID
        Next

        For i = 67 to 90
            strDrive = Chr(i) & ":"
            If objDictionary.Exists(strDrive) Then
            Else
                strDrives = strDrives & strDrive & vbCrLf
            End If
        Next

        arrDrives = Split(strDrives, vbCrlf)

        For Each strDrive In arrDrives
            Set objOption = Document.createElement("OPTION")
            objOption.Text = strDrive
            objOption.Value = strDrive
            AvailableDrives.Add(objOption)
        
    End Sub
</SCRIPT>
<body>
    <select size="26" name="AvailableDrives" style="width:30">
    </select>
</body>
</html>
Execute it from TC using %windir%\system32\mshta.exe <fullpath to>\AvailableDriveLeter.hta in command line or in a user command...
You can also just launch the hta file and register with Microsoft (R) HTML application host.
You will see if T drive is usable or not !
User avatar
Dalai
Power Member
Power Member
Posts: 10023
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Running Veracrypt from TC results in missing drive

Post by *Dalai »

Not sure if I remember that correctly, but doesn't TrueCrypt/VeraCrypt show the (available) drives in its GUI? Launch it from TC and from Explorer (not simultaneously) and compare the shown drive lists.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: Running Veracrypt from TC results in missing drive

Post by *Mjolnir »

How about create 2 buttons, one for mount, one for dismout ?

Code: Select all

TOTALCMD#BAR#DATA
C:\Program Files\VeraCrypt\veracrypt.exe
 /l T: /v C:\database.dat /password 12344 /q
C:\Program Files\VeraCrypt\veracrypt.exe,1
VeraCrypt (mount T)
C:\Program Files\VeraCrypt\

-1
... and you may specify a "?" right before the "Parameters" to show command line (from TC) or even, not specify "/password 12344" for a user password request

Code: Select all

TOTALCMD#BAR#DATA
C:\Program Files\VeraCrypt\veracrypt.exe
/dismount T /q
C:\Program Files\VeraCrypt\veracrypt.exe,2
VeraCrypt (dismount T)
C:\Program Files\VeraCrypt\

-1
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
User avatar
Mjolnir
Member
Member
Posts: 133
Joined: 2005-10-08, 21:03 UTC

Re: Running Veracrypt from TC results in missing drive

Post by *Mjolnir »

Else, enjoy, here my script:
  • If Volume "T" exists (is already mounted), it closes it
  • If Volumes does not esists, it mount it (note: if you do not specify the password on the "CALL :_VCProcess" line, it asks user for)
... and you can mount/dismount many volumes in same script/time (duplicate & adapt the "CALL :_VCProcess" line)

Note: I'm using a protable version of VeraCrypt, don't know if has impact on your "user rights" points...
Note2: maybe, do not have your volume file directly on "c:\" root

Code: Select all

@ECHO OFF
SET VCExe="C:\Program Files\VeraCrypt\veracrypt.exe"

REM CALL :_VCProcess <Letter> <VeraCryptVolumeFile> [<Password>]
CALL :_VCProcess T C:\database.dat 12344

EXIT

:_VCProcess
	SET VCLetter=%1
	SET VCVolume=%2
	SET VCPassword=%3
	ECHO.
	IF EXIST %VCLetter%: (
		ECHO # VeraCrypt UnMount %VCLetter%:
		%VCExe% /dismount %VCLetter% /q >NUL 2>&1
	) ELSE (
		ECHO # VeraCrypt Mount as %VCLetter%: for %VCVolume% ?
		If "#%VCPassword%#"=="##" (
			%VCExe% /l %VCLetter%: /v %VCVolume% /q >NUL 2>&1
		) ELSE (
			%VCExe% /l %VCLetter%: /v %VCVolume% /p %VCPassword% /q >NUL 2>&1
		)
	)
GOTO :EOF
Longue vie a TC... déjà + de 20 ans de bons et loyaux services chez moi !
LittleBit
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-04, 19:52 UTC

Re: Running Veracrypt from TC results in missing drive

Post by *LittleBit »

Dalai wrote: 2022-02-05, 12:03 UTC Not sure if I remember that correctly, but doesn't TrueCrypt/VeraCrypt show the (available) drives in its GUI?
Correct.... but...
a) in my BATchfile, veracrypt is implemented with commandline options and so no GUI available.
But when I skip password.... GUI appears and it shows that the requested drive is free.
b) even if a free drive is selected, VC can show the Errormessage "Drive letter not available".
LittleBit
Junior Member
Junior Member
Posts: 18
Joined: 2021-12-04, 19:52 UTC

Re: Running Veracrypt from TC results in missing drive

Post by *LittleBit »

Yes solved !!
- Enabled "Make disconnected network drives available for mounting" in VeraCrypt; Settings; Preferences.
- Run "mountvol.exe /R"
- Do reboot
I will be doing still several tests the next few days but I believe this solved it.
Post Reply