views:

428

answers:

1

I need to be able to programatically (from an installer program) install and run a windows service so that it will have elevated admin rights (the installer app has already elevated by this point), and also that it will restart at system startup with elevated rights. Is this possible?

A: 

You need to read up on OpenSCManager(), CreateService() and similar functions. Here's some sample code in C# that might get you started.

Cheers !

Magnus Skog