0

When I'm currently in a command line window and I change an environmental variable I have to reopen a cmd.exe instance. When I want to install a python package using pip from the command line I have to run it in administrator mode as well.

I was wondering if there is a command / shortcut to reopen a cmd.exe instance in administrator mode.

I know I can use start cmd.exe to open a new command line instance and I've seen that apparently you can use runas to run a service from the command line in administrator mode, but this prompted me for my administrator password which does not correspond to my user password apparently.

  • 2
    If the user you are logged into, is not an Administrator, you will have to input an elevated user's permissions in order to do what you want. – Ramhound Aug 7 '18 at 14:22
0

If you already started cmd as administrator then you can simply create another (child) copy of administrative console that will inherit parent's environment without providing admin's password by simply running:

start  

so in your case set environment variables you need in parent administrative console, then run start

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.