Click here to Skip to main content
14,713,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello people. I want to run my program written on C# run as NT Authority\System, which means that it will have more privilegies as Administrator. How I can realize it?

What I have tried:

On app manifest you can change invoker as Administrator, but there are no properties for NT Authority\System.
Posted
Updated 6hrs ago
Comments
Richard MacCutchan 11hrs 15mins ago
   
That is correct. It is a system protection feature.

As far as I am aware, you can't tell an app to run under any specific user as part of the application itself, but you can instruct the system to do that when you actually run it.
This may help, though I haven't tried any of them and accept no responsibility should anything untoward happen to your system or app as a result: How to Run a Program as SYSTEM (LocalSystem) Account in Windows ? Winhelponline[^]
   
Comments
Ashotiklm 10hrs ago
   
Maybe I need to create service which will be runned as NT Authority\System. I hope it will help.
It's possible to do it if your app is launched from a Windows Service. Services run as System if you don't supply a user account to run them under.

If your app requires user interaction, launching the process gets complicated. You're going to have to launch the process on the correct Desktop so the logged in user can see it, otherwise your process will launch on the service Desktop and not be visible to the user.

Launching a process on another Desktop is not an easy thing to do. It takes a considerable amount of work to accomplish this. You cannot use the Process class in the .NET Framework to launch a process on another Desktop. You have to use the Win32 function CreateProcessAsUser with an altered user token of the active console session. I leave it to you to figure out how to get that token and how to edit it.
   
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900
亚洲日韩欧美国产专区_一本二本三本道不卡日本_在线不卡日本v二区三区18