Click here to Skip to main content
15,894,460 members
Articles / All Topics
Technical Blog

Opening Apps from the Directory You're in as Administrator

Rate me:
Please Sign up or sign in to vote.
5.00/5 (1 vote)
12 Sep 2017MIT1 min read 3.8K  
Opening apps from the directory you're in as administrator

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

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

The Problem is…

You see the problem is every time I need a CMD or PowerShell window, it generally needs to be running in admin mode (anyone 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 I decided to write code to make it possible for me. I won't go into too much detail because the code is on GitHub (http://go.beeming.net/2hocTo8). 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.

    explorer_2016-12-13_13-13-16

  3. Type any command:

    explorer_2016-12-13_13-14-26

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

    cmd_2016-12-13_13-15-19

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

This article was originally posted at http://beeming.net

License

This article, along with any associated source code and files, is licensed under The MIT License


Written By
Architect SSW
South Africa South Africa

Comments and Discussions

 
-- There are no messages in this forum --