Can't run File Explorer as different user

8

Following on from this question about opening file explorer as a different user, I've tried navigating to C:\Windows, shift+right-clicking explorer.exe and clicking "Run as different user". When I enter the login details of the user, I get 2 successive error messages, both of which say

Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item

If I try the login details of the account that's currently logged in, it works, but the other doesn't. This is the case for both accounts (admins) on my PC.

Edit

There has been some confusion in the comments. I'm trying to follow the accepted answer in the question linked above, and it's not working. Some people are saying it can't be done, so it's odd that there is an accepted answer with 3 upvotes

binaryfunt

Posted 2016-09-22T10:58:33.590

Reputation: 650

@BlueBerry-Vignesh4303 Users on my PC have both Read and Read & Execute permissions for explorer.exe – binaryfunt – 2016-09-22T11:05:10.657

My general thought it would be since explorer[already a parallel explorer process running at existing user]is common directory which is common for both which serves exploration of files in windows directory so it might not be accessible by another user,is the same result while executing any other microsoft programs like cmd.exe? – BlueBerry - Vignesh4303 – 2016-09-22T11:12:19.333

@BlueBerry-Vignesh4303 I can open cmd.exe just fine as another user. If the linked question's accepted answer (3 upvotes) says do what I tried to do to run explorer as a different user, it ought to work – binaryfunt – 2016-09-22T11:15:29.553

If you can open cmd just fine, from there type start . and it should open an explorer as that user. – LPChip – 2016-09-22T11:17:23.070

@LPChip I get the same error message if I try that, and it says Access denied on the newline (normal cmd prompt can still open explorer as current account) – binaryfunt – 2016-09-22T11:37:24.603

You can't have explorer.exe open as another user. If you want to do it that way kill explorer.exe using the task manager and start it as a different user afterwards. Generally it's not such a goo idea. What use case do you have that would make you do this? – Seth – 2016-09-22T12:41:27.677

@Seth Then why has the linked question got 2 upvotes and an accepted answer with 3 upvotes if you can't do it? The reason I'm trying to do it is a long story – binaryfunt – 2016-09-22T12:47:21.687

I don't know? You'd have to ask the original person why he accepted it as the solution. What I can tell you that it works if you try to run it as an Administrator. So you're probably lacking privileges. As explorer drives a lot of things it can be quite complicated. There might be a better solution to your original problem or it could be easier to use a third party file explorer. – Seth – 2016-09-22T13:05:27.860

@Seth Have you tried the steps I've tried? Do you also get this error? – binaryfunt – 2016-09-22T13:11:56.177

Yes I did if I try to run it as a normal user using the "Run as different" user option. If I use "Run as Administrator" it works, as long as I supply some credentials that have administrative privileges. – Seth – 2016-09-22T13:22:30.913

@BinaryFunt - If you can't tell us what problem your trying to solve. We can't help you solve it in a way that is possible. Typically you would have to end the current explorer.exe process, in order to start it, with elevated permissions. I say elevated permissions because running it as a different user, logically, does not appear to be any different. The fact you are "right clicking" stuff tells me explorer.exe is already running. – Ramhound – 2016-09-22T18:56:01.080

@Ramhound I had thought it would be entirely possible to run explorer as a different user based on the linked question. So the problem is why it won't work. – binaryfunt – 2016-09-22T20:45:22.077

How you are trying to do it, won't work, you can't run explorer as another user with explorer already running. – Ramhound – 2016-09-22T20:47:04.650

I believe the answer by John Eisbrener explaining why you can't is the correct answer to this question.

– James Jenkins – 2017-10-24T13:58:42.463

Possible duplicate of How to launch Windows Explorer with the privileges of a different domain user?

– G-Man Says 'Reinstate Monica' – 2018-01-19T02:53:19.127

@G-Man That seems to be more about network share. If anything, my question is a duplicate of Runas Windows Explorer in Windows 7 actually (the question linked in the one you've linked)

– binaryfunt – 2018-01-19T11:39:19.827

Answers

6

Per this TechNet Blog Post, explorer.exe looks to be single threaded and won't allow multiple threads running under different user accounts:

Windows Explorer was not designed to run in multiple security contexts in the same desktop session, Windows cannot simply throw up a UAC prompt and then launch an elevated instance of Explorer

The most useful alternative to using explorer.exe, as also outlined in that article, is to download explorer++ and run that as the user you wish to browse files as. You can connect to UNC paths just as easily in explorer++ as you would with explorer, so it seems to be a sufficient alternative. This is also the easiest approach I've come across that doesn't require elevated permissions (such as those needed to meddle in the registry or install additional software).

John Eisbrener

Posted 2016-09-22T10:58:33.590

Reputation: 161

2This looks like the correct answer. I have found the same obstacles as the OP. I believe this answer should be the accepted answer. – James Jenkins – 2017-10-24T13:57:14.190

1

From what you can read in other questions (1,2) regarding this topic it's usually hacky at best and certainly not a supported scenario. Further more the second question has some more information and if you follow a few links you'll end up here: And so this is Vista…

If you check that article you'll read the following:

On Vista, however, there are more changes. Neither Internet Explorer nor Windows Explorer is willing to entertain multiple accounts on the same desktop. If you try to run IE under a different user account from that of the desktop, it will display an error message: “The RUNAS command is not supported.” As I understand it, the primary reason is that with Protected Mode Internet Explorer, which runs at Low Integrity Level, IE also launches a Medium IL broker process (ieuser.exe) which runs as the desktop user and which gates selected Medium IL operations for the Low IL process. Allowing multiple identities into that mix would have introduced significant complexity best avoided. If you try to run Windows Explorer as a different user, you’ll see nothing – the new process starts but exits without displaying a window.

...

Explorer is a little trickier. Directly applying “Run as administrator” won’t do it, but running it from an elevated command shell often will. I find that a command line like “explorer /e,c:\” will work, while just running “explorer” might not. But as before: if it works at all, it is an unintentional side effect of the current implementation, and is subject to change at any time.

It's reasonable to expect them to keep this behavior as they had it in Windows Vista, Windows 7, Windows 8 and now (probably) Windows 10.

So it seems you'll either have to use a hack, consider a workaround, or reevaluate your problem that leads to you having to run an explorer as a different user.

As a workaround you could use a different file explorer like Total Commander, a cmd that is running under different credentials, a file open dialog of some other software you started as a different user or the windows "fast switch" to just temporarily switch to the other user.

You didn't really provide any information why you're trying to do this so I have no idea what a different approach could look like and as for the hack ... there are multiple in the questions above. My guess why the one you linked in your initial question was masked as solved is that the person did some more research and maybe stumbled upon on of those hacks.

Seth

Posted 2016-09-22T10:58:33.590

Reputation: 7 657

1

Setting Explorer to open folders in separate processes used to allow this to work under 1511. E.g. at a command prompt running as user1, "explorer c:\somePath" would open an Explorer window running as user1, while from a command prompt running as UserZ, the same command would open an explorer window running as UserZ.

After upgrading to 1607, that broke. Right-click and run as different user results in the same errors stated above.

Launching explorer from the command prompt, no window is ever displayed, but a new explorer process owned by the currently logged in desktop user. That process eventually goes away on its own. I have watched a couple of times where the new explorer process launches as the user that invoked it, then that process immediately closes, and a new process owned by the desktop user is spawned (and never shows up, and after a bit is automatically killed). I suspect this is always the case, just usually happening too quickly to observe in Task Manager. Process Monitor or something similar would probably help proving this, but I haven't bothered, since I probably can't fix it anyway. :\

user705022

Posted 2016-09-22T10:58:33.590

Reputation: 11

1

An interesting workaround that I recently discovered myself, and nobody here has yet mentioned:

Spawn any process/program as a different user (e.g. Notepad), and depending on the program and the framework used, you can use the Common File Dialog Box API to do a lot of regular "explorer" shell operations.

(Simply select Save as.. or Open... from the menu, and use context menu to perform copy/paste, etc., then "cancel" the dialog).

How to run as different user in the first place

To spawn any program as a different user, use the sysinternals shellrunas, which can install a context-menu item. Alternatively, spawn a cmd with builtin Windows runas, then start a program that uses a Common File Dialog Box API.

Hatebit

Posted 2016-09-22T10:58:33.590

Reputation: 151