This project has moved. For the latest updates, please go here.

Windows 10: Command line task does not terminate.

Topics: Technical Issues, Users Discussion
May 1 at 10:57 AM
For a long time, I have been using a script for my backups that mounts a volume using veracrypt.exe (in portable mode) with command line parameters:

.. some stuff
veracrypt.exe /q /v containerfilepath /l G /b /k keyfilepath
.. more stuff

Until recently, this has worked fine, but now, and sometimes only, the veracrypt.exe process does not terminate when the UI closes and the rest of my script is blocked. If I watch using Task Manager I see Veracrypt in the Apps list while the UI is showing and then it moves to the Background processes list. If I then do End Task on it, my script unblocks and completes normally.

There is no taskbar icon showing and the VeraCrypt Background Task is disabled in Preferences (as well as /q being specified in the command line).

Anyone have any insight on what might be happening here? I am ready to perform any experiments suggested.
May 1 at 2:14 PM
Edited May 1 at 2:14 PM
Did the problem start when your PC upgraded to Windows 10 Creators Edition?

Click on the Windows icon in the lower left of your screen and type "winver" without quotes then hit return.

Currently, Windows 10 Creator version is 1703 with OS build 15063-250.
May 1 at 6:38 PM
Edited May 1 at 6:39 PM
I've no insights into why this might be happening, but you could work round it:

.. some stuff
start veracrypt etc
timeout /t 10 /nobreak > nul
.. more stuff

May need to adjust the timeout figure.
May 1 at 6:50 PM
And, if you want to be sure veracrypt has terminated, try (between timeout and more stuff):

set prog=veracrypt.exe
for /f %%a in ('tasklist /nh /fi "imagename eq %prog%"') do if %%a == %prog% taskkill /im %prog% > nul
May 4 at 5:44 PM
Edited May 4 at 5:53 PM
Enigma2Illusion: Yes, I am using the Creator Edition (1703/ 15063.138). And it is certainly possible that the problem started at the upgrade.
May 4 at 5:51 PM
Thanks AdrianKIT, however I do not really care if the process has terminated. I just care if the UI has completed and am using the process termination to detect this. A timeout is no good because I cannot predict how long the user will take to respond to the key entry dialog.

I confess I'm not actually using DOS scripting but my own Lua based scripting system. However I have tested the process starting and termination detection using notepad.exe and it works fine. I do think the problem is intrinsic to veracrypt.exe