How to run command prompt as admin?

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
sqa_wizard
Power Member
Power Member
Posts: 3893
Joined: 2003-02-06, 11:41 UTC
Location: Germany

Re: How to run command prompt as admin?

Post by *sqa_wizard »

I'm wondering how to do this for powershell.
For PowerShell 5 try:

Code: Select all

TOTALCMD#BAR#DATA
*"%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe"  -NoExit -Command
"cd '%P'"
powershell.exe,1
Elevated Powershell Prompt


-1
For PowerShell 7 adapt the path accordingly.
#5767 Personal license
avada
Senior Member
Senior Member
Posts: 217
Joined: 2007-10-05, 06:24 UTC

Re: How to run command prompt as admin?

Post by *avada »

Thanks.
Windows 10
User avatar
Sopor
New Member
New Member
Posts: 1
Joined: 2025-01-06, 23:22 UTC
Location: Sweden

Re: How to run command prompt as admin?

Post by *Sopor »

I don't want to turn off UAC and we all know it will show a warning message every time you want to run an application as Administrator.

I have created a batch file that will run through the "Task Scheduler" and at the same time open a command prompt in current window as Administrator.
I have created a guide and maybe it will be useful for someone :)

You will find the guide here: https://gist.github.com/Sopor/57f21eaa12be62b3592b0fdcf2477799
I don't use any third-party applications.
Post Reply