Making your assembly run "as Administrator" in Vista
Posted by: Peter Brombergs UnBlog,
on 03 Apr 2007 |
View original | Bookmarked: 0 time(s)
This came from one of my favorites in the C# newsgroup, Willy DeNoyette. I'll simply post the questions and answers directly, since there is no need to modify it except for some formatting and cleanup:Q) I need to restart the "Windows Audio Service" (audiosrv) via C#. I'm using the ServiceController Class to do this.It is no problem under XP and no problem under vista if UAC is disabled.But with enabled UAC i'm getting a "access refused" exception.I also tried to do it via console with "net start...