Share via

How to code run-as-admin?

Soar 121 Reputation points
2022-06-02T05:16:05.797+00:00

I've created a C# console app with Visual Studio to run cleanmgr, and it worked.

However, there are a couple of things which I failed to figure out:

  1. I couldn't find a way to run it as admin. Like what happened when I open an elevated cmd and run the command.
  2. The command I want is actually not cleanmgr, but "cleanmgr /d c". I couldn't code this.

I'd appreciate your help!

Developer technologies | Universal Windows Platform (UWP)
0 comments No comments

1 answer

Sort by: Most helpful
  1. Castorix31 91,871 Reputation points
    2022-06-02T05:47:59.247+00:00

    Was this answer helpful?

    2 people found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.