How to automount a Truecrypt volume before login in Windows 7?

1

I have an external hard drive containing all my documents, and it is encrypted with a password via Truecrypt. I'd like my desktop computer at home to automatically mount the volume prior to my logging in (so that it can be used as my user folder) without asking me for a password. (Yes, the password can be saved in plain text on my desktop's hard drive - that's okay.) For the life of me, I can't figure out a way to do this that actually works though.

Tried using the Task Scheduler to schedule a mount when the computer starts up, and it works, but the volume is only accessible by my user account after I log in. (Haven't tried every combination of users/options for the scheduled task, so maybe there's something else there I need to try.) Also tried adding a startup script for my user account that runs on login, which evidently is too late to set up the user's profile folder. Anybody ever successfully achieve this or something like it?

nonoitall

Posted 2012-06-13T09:53:08.103

Reputation: 185

I have never heard of running a program before a user logs into an account on Windows. How can you access a drive on Windows if you are not logged into the account? – Ramhound – 2012-06-13T11:20:22.963

Why do you need your user folder to be located in an external drive?. If you're talking about the default folder where documents are saved, it would be easier to set your library to include the external hard drive. If you're talking about the actual user folder, well, it's where Windows saves your personal program settings and data, so you can't login without it. – Martheen Cahya Paulo – 2012-06-13T21:24:52.517

I'm aware that I won't be able to log in without the drive. (Actually, I can -- Windows will just create a temporary user folder since the normal one is inaccessible.) That's the way I want it. This was fairly easy to do on Windows XP using a login script and my choice of registry tweaks or a junction, but evidently Windows 7 wants access to the folder before the login script runs. Having the user folder on the drive would just simplify things since not everything on the drive is organized into a "library". (Plus things like the desktop are not actual libraries to my knowledge.) – nonoitall – 2012-06-14T05:09:24.623

Answers

2

I was finally able to kind of get this working in the Task Scheduler by having the user called "SYSTEM" be the one to execute the task (on startup). If I attempt to log in to my user account too quickly, it doesn't work, but if I wait a few seconds it mounts and I can successfully log in. Wish there was a synchronous way to run a task prior to login...

nonoitall

Posted 2012-06-13T09:53:08.103

Reputation: 185

1

You could try running the commandline that mounts the drive as a service. It will end after a few seconds, but that probably doesn't matter.

To run any .exe as a service using srvany.exe from the resource kit:

http://support.microsoft.com/kb/137890/en

Under the parameters key as described in the tutorial, you can also add the REG_SZ value called AppParameters for any additional command line parameters.

Example:

Key: ...\services\servicename\Parameters 
Application = "C:\truecrypt.exe"
AppParameters = "mount c:\sometrufile somepassword"

I don't know the exact parameters for TrueCrypt, but that should give you a good idea of what to do.

sinni800

Posted 2012-06-13T09:53:08.103

Reputation: 3 048