Opening apps from the directory you in as Administrator

category: [ Powershell ] tags: [ Command Line ] [ Run As Admin ] [ Windows Explorer ]
created: 13 Dec 2016 @ 11:18 modified: 24 Apr 2017 @ 13:57

The other day I saw a post that Greg Duncan shared about opening CMD and PowerShell from the directory you in.

Now although there is no rocket science behind this I never thought to ever try it, now that I have tried it I can't use it Sad smile

The Problem is…

You see the problem is ever time I need a CMD or PowerShell window it generally needs to be running in admin mode (any one who knows how let me know Open-mouthed smile).

The Resolution is…

Now being a week since seeing the post I really feel that I should be using this gem so decided to write code to make it possible for me. I won't go into too much detail because the code is on GitHub ( Basically all you do is

1. Copy the admin.exe from the compiled folder on GitHub (or pull down the code and compile yourself) into your windows folder, which is location in C:\Windows by default.

2. Click in the address bar in windows explorer


3. Type any command


4. Press enter and see it launch that app as Administrator with the working directory set correctly


Hope this little utility will fill this little gap I had for others as well Open-mouthed smile


Gordon Beeming works at Nologo Studios in the sunny city of Durban, South Africa. He is the Lead for the Data and Services Team and has a strong focus on Developer Efficiencies and R&D. When he's not hacking away at a keyboard in Visual Studio he'll generally be relaxing with his family or hitting the black top getting in some mileage. He is a Visual Studio ALM Ranger and Visual Studio ALM MVP.

Follow me on Strava


I plan on writing a bunch of online tools and sharing the code for how I made those tools. If you have any feedback you can ping me on Twitter (@GordonBeeming) or mail me [email protected].