Make windows service run as if it was run from a specific user
问题 I want to create a windows service to mount and dismount a True Crypt volume. (this question is not about true crypt so if you do not know what that program that is ok. True Crypt is just a program that enables you to encrypt data. When you decrypt it then trueCrypt will create a virtual drive where you can see the contents unencrypted). Here is the code I use in my console application: static void Main(string[] args) { Test(); } static void Test() { try { // location where true crypt is