Menu

Scheduler task - dismount blocks drive letter

jamesdts
2016-06-10
2019-05-14
  • jamesdts

    jamesdts - 2016-06-10

    Hello,

    I encounter a strange problem with volume dismount.
    OS : Windows Server 2008 R2 SP1 64bits
    Veracrypt version : 1.17 64bits
    Volume type : full partition
    I'm on the Administrator account, full privileges

    As I want to mount/unmount the volume and share/unshare it at the same time, I use 2 .bat scripts to do those operations.

    Here are the parts regarding the veracrypt command for :

    • mount :
      "C:\Program Files\VeraCrypt\VeraCrypt.exe" /q /v \Device\Harddisk1\Partition1 /l y
    • dismount :
      "C:\Program Files\VeraCrypt\VeraCrypt.exe" /f /s /q /d y

    Launched manually, both scripts are working very well and there is no problem.

    The problem is occuring when I try to automate the dismount script with the Windows scheduler task.
    The task completes "succesfully" (meaning no error) and the volume is dismounted.

    But the drive letter (Y:, here) is not released. It still appears into the computer explorer, and when I try to enter it, I got an error message : "Location is not available"

    If I try to execute once again the mount script, it's not working anymore and the volume isn't mounted, as if the drive letter was still used.

    Note : if I try to mount the volume on another drive with another letter (Z, for example), it's working fine.

    The only way I got to free this drive letter is to reboot my server...then it's working fine again, until the next automatic scheduled dismounting operation...

    I tried every options into the scheduled task, change priority, privileges, nothing worked.

    I repeat to clarify mo position : launched manually, everything is working fine ; launched with scheduler task, the drive letter isn't released.

    By browsing this forum and others website, I find some clue about the regedit information into HKEY_LOCAL_MACHINE/SYSTEM/MountedDevices, about some keys listed here blocking the drive release.

    I've checked this point, and it's not solving my problem.

    Does anybody already have the same problem ?
    Any idea how to solve it ?

    And no, the automatic dismounting options into veracrypt don't suit to me :)

    Thanks !

     

    Last edit: jamesdts 2016-06-10
    • JB Borden

      JB Borden - 2017-07-17

      Did you ever find a resolution to this issue? I have EXACT prob. on VC1.19, full partition

       
  • Alex

    Alex - 2016-06-11

    Hi,

    Strange. Could you try to remove the letter via diskpart?

    DISKPART
    REMOVE LETTER=Y

     
  • jamesdts

    jamesdts - 2016-06-12

    Hello,

    It's not working, error message :
    "Virtual disk service error :
    The path is not found."

    And the unavailable drive is still present into my computer explorer.

     
  • Konstantinos N

    Konstantinos N - 2017-09-18

    Any updates on this? I have exactly the same issue as the OP, using Win 10 1703 64bit, Veracrypt 1.21. Script using Task Scheduler to mount/dismount a file volume during user logon does not release drive letter properly. Same script works great when run outside of Task Scheduler. The exact command line being used is

    "C:\Program Files\Security\VeraCrypt\Veracrypt.exe" /d y /f /s /w /q background

    The script is run with 'highest privileges' in Task Scheduler.

     
  • Simeon Steffen

    Simeon Steffen - 2019-05-14

    Same Problem here
    using Version 1.23-Hotfix-2 on Server 2012 R2 (Build 9600)

    Start Command is:
    $startstring = A:\App\VeraCryptPortable.exe /s /q /d A:\Container\backup.hc
    iex $startstring

    no problems running this command in shell
    but by starting this via tasksched, driveletter B: (the encrypted container) is sticky.

    Get-WmiObject -Query "select * from Win32_LogicalDisk where name='B:'"

    DeviceID : B:
    DriveType : 3
    ProviderName :
    FreeSpace :
    Size :
    VolumeName :

    checking with diskpart. There is no disk an no volume
    tried cleandrive and diskpart
    no way getting rid of B:

     

Log in to post a comment.

MongoDB Logo MongoDB