How do I run the Windows 7 Explorer shell with Administrator Privileges by default?

31

10

The Windows 7 shell (Explorer) can be made to run with Administrator privileges by this manual process:

  1. Kill Explorer shell by holding down Shift+Ctrl, right-clicking the Shut down button in the Start Menu, and selecting Exit Explorer
  2. Start Task Manager with Ctrl+Shift+Esc
  3. Elevate Task Manager privileges by going to Processes tab and selecting Show processes from all users
  4. Then start up a new instance of the shell by File | Run in Task Manager, typing in explorer, and selecting the Create this task with administrative privileges.

After following the above process, the Windows shell will be running with administrative privileges, and any programs it launches will also have administrative privileges. This makes performing tasks that require the privilege far easier, particularly for command-line applications, which usually fail silently or with an Access denied. message rather than giving an opportunity to use UAC to elevate the process's privileges.

What I'm interested in, though, is creating an account which uses a privileged shell by default, rather than having to follow this laborious process every time. How can it be done?

Barry Kelly

Posted 2009-10-22T16:37:47.683

Reputation: 713

@BarryKelly - old thread, but new info: On Windows 8.1, "Run as Admin" works nicely. So I have shortcut to cmd.exe, check this, and the shell even gets an orange frame. Only disappointment is that the "Start in Folder" option is not respected anymore. – virtualnobi – 2015-07-20T13:42:51.767

+1 for this and Ian Boyd highlighting a key usage - and therefore a real shortcoming in how Windows handles Administrator-privileged folders in explorer – underscore_d – 2015-08-01T19:49:40.483

@IanBoyd I'd welcome a suggestion for a better way of graphically browsing directories where you lack access. Right now I'm just trying to explore the contents of a system disk from a PC that's failed so I can back things up. Exploring via an admin PS prompt is painful mainly due to lack of thumbnails when deciding what media I want to backup. – deed02392 – 2016-07-24T11:40:29.077

Thank you very much for the information above, this will help me testing Drag&Drop while continuing to run the IDE as administrator to enable COM registration ;) – csharptest.net – 2010-08-04T18:03:23.680

9Example where this is useful. There is a folder you want to browse to that only Administrators have access to. You're an administrator, but not really because UAC is enabled. Normally you would simply elevate a 2nd copy of Windows Explorer, so you can then browse into that folder. Unfortunately you cannot run a 2nd copy of explorer.exe elevated. So the only fix is to kill your existing copy of explorer and run a fresh copy elevated. The tedious required steps given in this question are the required steps. A better solution would be better. – Ian Boyd – 2011-07-28T19:46:19.820

have you tried just opening explorer.exe properties, going to compatibility and selecting "Run as administrator"? Not in front of Win7 to try this myself. – Matt – 2009-10-22T16:50:51.900

Compatibility tab is disabled for Windows component programs. – Barry Kelly – 2009-10-22T17:08:22.817

1Isn't this exactly the same thing as disabling UAC? After all, UAC works by causing the explorer to drop its administrative privileges on startup, and then allowing you to elevate permission later on. – tylerl – 2009-11-11T07:32:43.487

Answers

8

As far as I know you can't create an account like this, but if you log in as "Administrator" (Not merely as an account that is a member of the Administrators group - that's not good enough.) then everything you launch will be launched elevated.

Not something you should do normally, but if you need to then you need to.

Mark Allen

Posted 2009-10-22T16:37:47.683

Reputation: 2 801

You need to 'unhide' the administrator account first. – jiggunjer – 2016-01-17T12:34:01.880

5

This is a terrible idea. You want to go back to the Win XP days where everything runs as Administrator? You're giving up all the security gains made by Vista and Windows 7. GUI applications should all invoke UAC, so there's no need for this hack in that case.

If you need to run command line apps as administrator, simply open an administrator command prompt. It's very easy, just press WIN, type 'cmd', then press ctrl+shift+enter. Or even simpler, you can make a shortcut to cmd, and in the settings set it to 'Run as administrator'

davr

Posted 2009-10-22T16:37:47.683

Reputation: 4 809

2Ok then, my answer is here for the sake of other users browsing who might not realize that this is a bad idea. I did try to add something helpful, how you can accomplish your objectives in a different way. If you gave more details on what your objectives really were, perhaps people could give other advice as well. – davr – 2009-10-23T05:47:53.977

5

As to the original question if you are running the ENTIRE shell with admin rights you might as well log in with an admin account and be done with it. You're basically destroying the purpose of the account division as far as security is concerned. What I'd recommend is running explorer as a separate administrator account.

Easy solution for launching explorer as admin:

  • Run a CMD window as your admin account.
  • Type 'explorer'
  • Enjoy explorer with admin rights

Note: This does not work in a PowerShell window and I've no clue why. For example.. Launching a PowerShell window as an admin user (and I'm not talking about run as administrator here) and entering 'explorer' or 'invoke-item explorer.exe' will launch the window but with only user rights; however, typing 'CMD' in that same PowerShell window and then just 'explorer' will work.

Other super fun hidden thing note: Most people don't know this but there's a check box to always run PowerShell windows as administrator so you don't have to always shift-right click and select it (since most of the stuff you do in PowerShell requires admin anyway). To find it:

  1. If pinned (or in the dumbass metro thing probably too) (win 7/8) to taskbar Shift+RightClick the shortcut otherwise just go to properties of shortcut
  2. Click Properties
  3. Click Shortcut Tab
  4. Click Advanced...
  5. Check box 'Run as administrator';ok;ok
  6. Live life happier

Warai Otoko

Posted 2009-10-22T16:37:47.683

Reputation: 51

3

Why not turn on auto elevate for the built-in Administrator account?

Launch Local Security Policy

Go to: Local Policies \Security Options

Look for: User Account Control: Admin Approval Mode For The Built-in Administrator Account and make sure it's disabled (this is the default value anyway).

Now you can Fast Switch to the built-in Administrator account for all your admin needs.

surfasb

Posted 2009-10-22T16:37:47.683

Reputation: 21 453

3

It is correct that starting with Win 7 there is no simple way to run Windows Explorer with admin privileges. The normal "Run as Administrator" is by default ignored for Explorer.

But there is a nice workaround if you don't need these elevated permissions very often:

The file dialogs (Open, Save as, ...) of any Windows applications are nearly complete Explorer incarnations, and they inherit the user rights of their application. So if you start Notepad as Administrator and open the "File Open" dialog, you can use it to manipulate files with Administrator privileges. You can modify and delete protected files and you can change ownership to your standard user.

Jpsy

Posted 2009-10-22T16:37:47.683

Reputation: 385

1

If you turn UAC off then what is the remaining problem?

You could try the methods in this article by Aaron Margosis, which is for Vista but may well work on Windows 7 (I have not tested this).

@Andrew Some apps don't behave properly with UAC because they are not written properly to work with UAC, and often this is because they were not written properly in the first place. Usual suspects are things which try to write user-level registry settings under HKLM. UAC helps by virtualising this, but if a later part of the code which reads the setting is hard-coded it may bypass virtualisation, not find the setting and not behave as expected (this is also why it is a really bad idea to turn off UAC while you install and configure all your apps and then turn it back on afterwards, as the settings can end up in some strange places)

AdamV

Posted 2009-10-22T16:37:47.683

Reputation: 5 011

0

Quick way to get an elevated explorer window:

  1. Hit windows button and type cmd to find it
  2. Right click cmd (or press menu button on keyboard) and choose "Run as Administrator"
  3. Type explorer <return> in the elevated command window

00prometheus

Posted 2009-10-22T16:37:47.683

Reputation: 556

0

There is an option in the Explorer "folder options" to run every new explorer window as a seperate task. Whit this enabled you should be able to run a 2nd copy of explorer.exe elevated...

Also possible is running an instance of eg. mspaint with the runas command (runas /user:yourdomain\youradminuser mspaint) and then go to file - open. Voila, you have your elevated explorer...

Langhard

Posted 2009-10-22T16:37:47.683

Reputation: 560

1You also get an option a new explorer window in a new process if you (Shift)+(right-click) on a folder in the directory tree, in the left pane.  "... you should be able to run a 2nd copy of explorer.exe elevated..."  OK, have you found a way? – G-Man Says 'Reinstate Monica' – 2015-05-07T07:46:29.060

1This is not the same G-Man. If you Shift-Right click you get a new window, but this window runs under the same task (process). – Langhard – 2015-05-07T09:13:14.833

2

See this.

– G-Man Says 'Reinstate Monica' – 2015-05-07T10:38:39.293