0

the title pretty much says what I want to do. I would like to start my application from Visual Studio with system privileges. I found this topic about starting an application already: How can I run a application under SYSTEM?

I managed to start the application with it, but I will not be able to debug it ofcourse. So I wondered if there is a way to start my application with system (service) previleges.

Thanks

Community
  • 1
  • 1
DerApe
  • 3,097
  • 2
  • 35
  • 55

1 Answers1

1

In order to debug processes that run under system accounts, you need to start your debugger (Visual Studio) as administrator. Then instead of launching the application from the debugger (F5), choose "Attach To Process" from the Debug menu. You may need to check the "Show processes from all users" checkbox.

bmm6o
  • 6,187
  • 3
  • 28
  • 55
  • You also may want in include instructions on how to attach the debugger to a already running process. – Scott Chamberlain Oct 21 '13 at 17:58
  • This was the way I did it. Thanks. I guess there is now way to start the process from the beginning in debug mode right? Because I can not really debug the startup of the application. I guess I would have to put a `Thread.Sleep() ` or something like that when starting the application!? – DerApe Oct 22 '13 at 06:24
  • You might try http://stackoverflow.com/questions/104235/how-can-i-use-debugbreak-in-c to bring up the debugger dialog. – bmm6o Oct 22 '13 at 15:52