When working with Windows File Explorer on the server as local administrator, you often have to open system directories, user profiles or edit protected system files. When trying to open such directory/file in Windows Explorer in the current context, the UAC warning appears prompting to grant access and elevate privileges.
What it looks like: let’s try to open a system folder C:\Windows\security\audit in Windows Explorer. User Account Control window appears to warn that you cannot access this folder (You don’t currently have permission to access this folder). But you can get the access by clicking Continue.
It’s ok, but if you do it, your account is explicitly written in the NTFS permissions for the folder. But all you want to do is to look through the contents of the folder, and not to change its ACL!
Naturally, when you often work with system files, this UAC warning becomes irritating. Since we didn’t want to disable UAC, we had to find our own way to start elevated Windows Explorer process (Exploler.exe)
- Run cmd.exe as administrator
- Run the command:
tskill explorer & explorer
This command will terminate the current explorer.exe process for this user and start a new one that will inherit the elevated access token cmd.exe is run with.
You can make sure that Windows Explorer is running elevated in the Task Manager. Start it, and go to the Details tab. Right-click any column, click Select columns and enable Elevated column to be displayed. As you can see, explorer.exe is now having attribute Elevated=Yes.
After that Explorer will be able to open any system folder without a UAC warning, and all child processes run from Windows Explorer will run elevated. For example, it is convenient when you need to edit hosts file (c:\windows\system32\drivers\etc): you can open it right from Explorer using Notepad, with no need to start a separate notepad.exe process as administrator.
To make it partially automatic, you can create a .bat file containing this command on the desktop and right-click to run it as administrator to elevate privileges.
7 comments
I tried this from a Windows 10 LTSB 2015 machine and it didn’t work. I was excited to see the article because you are correct this is a pain. Do you have any suggestions?
This trick only works on Windovs Server 2012 R2
Ok, that makes sense then. Thanks.
Not working on Windows Server 2016. Always starts explorer.exe without Elevated privileges
Try this – start an elevated command prompt, open task manager, right-click explorer.exe in details pane, and ‘End task’. Then, switch to the command prompt and run explorer. Seems to prevent the auto-restart of explorer.exe when you try it the above way.
What you need to do on W10/WS2016 and newer is:
– open Task Manager
– kill Explorer.exe process
– click the File menu, select Start new task, type: explorer /nouaccheck, be sure to tick the ‘Create this task with administrative privileges’
– click OK, there’s your elevated Explorer again
worked beautifully thanks brskie