I have a 1TB USB disk where I make the first level of backup of a WS2008 R2 file server. The usb is not fully encrypted, just about 700GB. Cobian is running as a service, impersonating Administrator user when doing backups.

It happened that "accidentally" some guy unplugged the USB and then plugged it again. It is not a big deal as everyday I check the backups, but I wanted to make a script to mount the encrypted file just in case before doing the backup. The script works ok if I execute it, but it seems to fail if executed by Cobian with no session opened. Cobian always fails as doesn't find the mounted unit (T:). The script, in a .bat file:

"[fullpath]\truecrypt.exe" /v z:\backups /l t /k [keyfilepath] /a /q /s /c n > "C:\mount.log"

Z is the usb, it always takes that letter when plugging it. Also, mount.log is always empty. I've read the TrueCrypt Known Issues and FAQ and I can't see anything related. Any idea about why does it fail or how to get log messages?

PS: I also tried mounting the encrypted file as Removable Media, with no luck. The USB gets mounted itself as drive, not as removable media.


Check the System & Application event logs.

To catch errors, change the end of the batch to: > "C:\mount.log" 2>&1

  • Tried again: mount.log keeps empty. Event viewer shows an event at the time of the task: (it is translated from spanish, so it may be incorrect): Registry:Application Origin: VSS Event Id. :8194 Task category:None Level:Error Key words:Classic User: Not available Host: ... Description: Volumen Shadow Copy Error: Error when checking IVssWriterCallback interface. HR = 0x80070005, Access denied. If often occurs by an incorrect security configuration in the proccess of writing or when applying for. I guess this is after the .bat execution, it shows 3 sec. later than the scheduled task. – Mike B Sep 17 '11 at 9:05
  • Not solved my problem, but I award the bounty as it was the first to point to explicitly set the error output. – Mike B Sep 24 '11 at 0:03

May be, if there is no open user session, Windows doesn't assign drive letter to usb device? Create a cmd file like this:

cd z:\ 2> c:\test.log
echo %errorlevel% >> c:\test.log

Schedule a task to run this task at time, when there is no open user session. Check c:\test.log

  • Good idea to check if z: exists. I would even pit a unique file, Z:\Special123 and then in the script "if not exist z:\Special123 goto ERROR or something similar. – jftuga Sep 20 '11 at 22:26
  • I'll try as soon as I can, but the backup gets done when I mount the unit with the shown script. It gets done in the middle of the night with, for sure, no session opened. – Mike B Sep 21 '11 at 7:06
  • Tried "cd z:\ 2> c:\scripts\test.log || echo %errorlevel% >> c:\scripts\test.log" in a .cmd file. When executed by task scheduler, test.log is empty. When executed by a fake task in Cobian it says "0". Not a surprise. The backup works with no session if nobody unplugs the usb. Cobian sees Z: and T: – Mike B Sep 21 '11 at 13:55
  • May be adding ' 2> "C:\mount.log" ' instead of ' > "C:\mount.log" ' would help? – Selivanov Pavel Sep 21 '11 at 19:14
  • I already tried with > "C:\mount.log" 2>&1 as jftuga said. Tried anyway with > "C:\mount.log 2> "C:\mount.log" with the same result. log is empty, unit is not mounted. – Mike B Sep 22 '11 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.