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.

1
  • 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
    Commented Aug 7, 2018 at 14:22

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .