Closed MullenStudio closed 1 year ago
I find it interesting that this is not considered a show-stopper bug. I was ready to stop using Visual Studio Code as my main editor until I saw the workaround by @ryansimmen for setting Code.exe to always run on Admin. This should either be the default or an option during install.
Does anyone know if vscodium has the same problem?
by creating a different user-data-directory (the place all our config etc. goes) depending on wether you run with elevated permissions or not. The reason is this:
As part of solving this problem, can you consider a rearchitecture that would maintain two parallel well-known user-data directories - one for elevated and another for non-elevated instance respective - and keep those in sync/merged automatically ?
code already has sync/merge capability for settings roaming, so perhaps that can be leveraged to sync/merge user-data across two local folders and deal with incoherencies between the two user-data instances.
now 2022, is it still impossible mission?
Please! Just attempt to create a file in C:\Windows
and delete it if it works. It's not that hard! If you have multiple sessions open, create two files, one for the elevated process and one for the non-elevated one. Make both watch each other's files and write data to their files, then delete them when they detect that there's nothing writing to the other file.
There are tons of solutions, just fix it already..
now 2022 ,the problem still exist 😢
Any update on this? This occurs on terminal servers, even though there is no admin login.
Now 2022 is going to be finished, the problem still exist.
It is annoying but its funny how we all complain about it but none's submitted a pull request. ;-)
It is annoying but its funny how we all complain about it but none's submitted a pull request. ;-)
Not every user running into this has the skills to do so. I certainly don't, I am a java dev. Others may be python devs etc.
Anyway, most of us would be happy with a workaround provided by Microsoft.
6 years old and STILL no fix.
This is really silly.
Aha, This bug let us meet at this corner~
The eternal flame!
On Wed, Aug 24, 2022 at 10:54 PM Yukang @.***> wrote:
Aha, This bug let us meet at this corner~
— Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode/issues/6560#issuecomment-1225557575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANAZWXVOSJRVFN4B7F2GG3V2X5ONANCNFSM4CEK7MIQ . You are receiving this because you commented.Message ID: @.***>
-- Justin Romaine Senior Architect Titanium Solutions Ltd. @.*** +64 21 764 506 hm 09 445 9166
I just ran into this because when I start a new code document, I typically type: code somesourcefile.c .py or whatever. Then in separate directory I click on a source file to look at a different piece of code and BAM! I get this pop-error. So apparently I cannot work in one directory where I need admin privs and a completely different directory where I don't. This is a really annoying feature!
I know. I can't see why they don't just request elevation by shutting down all code instances and relaunch elevated. You will get a uac prompt and off you go. Easy
We closed this issue because we don't plan to address it in the foreseeable future. If you disagree and feel that this issue is crucial: we are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding, and happy coding!
Ah. It is not intended to run VS Code on Terminal Servers? That should at least be worth a note in the README file. 🤔
You don't plan to address this issue? It is a critical feature for those of us who are required to run in both non-elevated and elevated environments due to security requirements? Do you have, perhaps, a best practices guideline that we could at least try to follow so that we can work?
Not addressing this issue is ridiculous. Simply having an elevated instance open should not preclude me from opening anything else. At the very least, present some options to allow the user to proceed, opening the requested file in the same elevated instance or open a new non-elevated instance automatically. At the moment the workflow is halted because VS Code simply says "no".
"Computer says no"
I'm threatening a pull request. In my world, there is no such think as "can't". VS Code is a pretty good product as everyone here would openly testify to but this is annoying and I would like more of an explanation as to WHY? this is not an easy fix. Is it a node binding limitation? an election no-no? maybe some limitation in the portability of the framework. I have not looked into it but i would be happy to discuss this issue with a developer that does. Maybe I could help.
Installing the system version as opposed to user version seemed to do the trick for me. Couldn't even fully uninstall user version due to user/appdata/local/programs permission issues.
EDIT: Nevermind, a few opens later the issue came back up. Notepad++ it is.
As a developer, I want to know why is this impossible? It's not that it cannot open in Admin or non-Admin at all. I can open:
I just noticed one thing that if VSCode is opened from PS, then some debug logs keep showing that is probably coming from VSCode. Is that pipe-to-console connection preventing it? If so, why to connect it ?
So what's the chance of this opening again? This issue is truly a deal breaker.
You can enable the compatibility tab on Windows by "Edit Group Policy". Then from the compatibility tab you can check the box "Run this program as an administrator". You'll need to restart your PC. It works on Windows 10 and 11.
Then from the compatibility tab you can check the box "Run this program as an administrator". You'll need to restart your PC. It works on Windows 10 and 11.
Can confirm that this workaround from @kakugiki works. Full steps below:
Then from the compatibility tab you can check the box "Run this program as an administrator". You'll need to restart your PC. It works on Windows 10 and 11.
Can confirm that this workaround from @kakugiki works. Full steps below:
- Search for vscode in the start menu and right-click, select "open file location"
- A new explorer window opens with the shortcut, right-click and select "properties"
- Navigate to "Compatibility" tab
- Under "Settings" check the "Run this program as an administrator" option
- Click OK or Apply
- You should no be able to run multiple instances as administrator - if not, try restarting your PC.
Executing always as administrator IS NOT a workaround.
Umm. It's now mid-2023. Please fix this already. I really need to have multiple CODE instances running as admin on Windows. Please make EVERY instance of Code use its own settings or whatever file. It's not that hard if you already support multiple instances of non-elevated execution.
Defining Code.exe to always run as administrator fixed this issue for me, but it should actually be the standard behaviour.
This is just silly. It's time to fix this behavior.
Then from the compatibility tab you can check the box "Run this program as an administrator". You'll need to restart your PC. It works on Windows 10 and 11.
Can confirm that this workaround from @kakugiki works. Full steps below:
- Search for vscode in the start menu and right-click, select "open file location"
- A new explorer window opens with the shortcut, right-click and select "properties"
- Navigate to "Compatibility" tab
- Under "Settings" check the "Run this program as an administrator" option
- Click OK or Apply
- You should no be able to run multiple instances as administrator - if not, try restarting your PC.
Thank you very much! It works for me too
I believe @johlju 's comment could be considered a type of workaround if you want to have multiple elevated VS Code instances with different directories.
Opening VS Code as elevated administrator in Windows. Then open an elevated PowerShell prompt and navigate to the folder, then issue
code .
will open the folder in VS Code in a new window. But if the PowerShell prompt is not elevated this does not work. I was expecting it to open in a new window, but not elevated.
So,
code .
opens that directory in VS Code in a new, elevated window and doesn't trigger a message saying you can't have multiple admin windows open.Just something that worked for my situation.
Steps to Reproduce:
Note: there are multiple other ways to trigger this issue, the above repro is just an example. Note 2: If you already have a code instance running without administrator running, the above issue will not get triggered. That's why the very first step is to close all Code instances.