Elevate cmd to admin with command prompt?
101,806
You can't change the permission from a current CMD.exe. You have to restart it. This is a Windows limitation. I use NirCmd with the elevate switch to start tools elevated.
Related videos on Youtube
Author by
Spring Page
Updated on September 18, 2022Comments
-
Spring Page over 1 year
Is there anyway to enable administrator access instead of having to right click command prompt and run as administrator?
I tried runas /user:administrator CMD (prompts for password) net user administrator /active:yes (System error 5 has occurred. Access is denied.) runas /user:administrator luaexec.exe -w -f cmd.exe /k
This is on my local machine running windows 8 and have no passwords on any accounts
-
Admin about 10 yearsWait... Do you want to elevate the current
cmd
or open a new, elevated one? -
Admin about 10 yearsI think there is a local security policy/directive that doesn't allow administrator logins nor executions for account with no passwords. Maybe that is your problem? Saddly, I don't know what directive that is, I suppose it should be at
secpol.msc
. If you find it, please, report. -
Admin about 10 yearsIs this method valid for you? superuser.com/questions/728810/…
-
Admin about 10 yearsI have used this other method, too, but it is shell programming. You could make a
.cmd
to call it with your desired parameters, if any: stackoverflow.com/questions/5944180/… -
Admin about 10 years@Plasma - within the current cmd
-
Admin about 10 years@nhat That is not possible, see this superuser question.
-
Admin almost 7 years
-
Admin over 4 yearsTry
gsudo
: superuser.com/a/1499989/45898
-
-
Spring Page about 10 yearsUnfortunately I'm trying to run a script to update IP addresses and what's preventing the command from executing is the cmd.exe needs to be in admin. It would be time consuming to go to every computer to do this.
-
Suncatcher over 6 yearsHow to run this from usual (non-admin) CMD? Is it possible?
-
mdcoder85 almost 3 yearsNo it is not possible.
psexec
installs temporary service with-h
and it requires admin privileges to do that... It is chick and egg problem. Just useCtrl + Shift + Enter
from Windows search results.