xxxxxxxxxx
how to open command prompt as administrator from run??
Using the run command
To do so, open a run-box, write cmd
And press Control + Shift + Enter to open the command prompt as an administrator.
xxxxxxxxxx
@echo off
break off
title C:\Windows\system32\cmd.exe
cls
:cmd
set /p cmd=C:\Enter Command:
%cmd%
echo.
goto cmd
xxxxxxxxxx
Set objShell = CreateObject(“Shell.Application”)
Set objWshShell = WScript.CreateObject(“WScript.Shell”)
Set objWshProcessEnv = objWshShell.Environment(“PROCESS”)
objShell.ShellExecute “C:\Windows\system32\cmd.exe”, “/k”, “”, “runas”
xxxxxxxxxx
if "%~s0"=="%~s1" ( cd %~sp1 & shift ) else (
echo CreateObject^("Shell.Application"^).ShellExecute "%~s0","%~0 %*","","runas",1 >"%tmp%%~n0.vbs" & "%tmp%%~n0.vbs" & del /q "%tmp%%~n0.vbs" & goto :eof
)