How to code run-as-admin?

Soar 106 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!

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,831 Reputation points
    2022-06-02T05:47:59.247+00:00
    2 people found this answer helpful.