Running Veracrypt from TC results in missing drive
Moderators: Hacker, petermad, Stefan2, white
Running Veracrypt from TC results in missing drive
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 ?
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 ?
Re: Running Veracrypt from TC results in missing drive
I guess you are running TC with different rights than Explorer.
Drives are account dependent.
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
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
Re: Running Veracrypt from TC results in missing drive
> 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 ?
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.
Re: Running Veracrypt from TC results in missing drive
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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Running Veracrypt from TC results in missing drive
> If you run TC as administrator,
Done ! But same results.....
Done ! But same results.....
Re: Running Veracrypt from TC results in missing drive
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
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 !
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>
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 !
Re: Running Veracrypt from TC results in missing drive
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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: Running Veracrypt from TC results in missing drive
How about create 2 buttons, one for mount, one for dismout ?
... 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
/l T: /v C:\database.dat /password 12344 /q
C:\Program Files\VeraCrypt\veracrypt.exe,1
VeraCrypt (mount T)
C:\Program Files\VeraCrypt\
-1
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 !
Re: Running Veracrypt from TC results in missing drive
Else, enjoy, here my script:
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
- 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)
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 !
Re: Running Veracrypt from TC results in missing drive
Correct.... but...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?
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".
Re: Running Veracrypt from TC results in missing drive
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.
- 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.