Cmd Runas Administrator Code Example


Example 1: how to run cmd run administrator using script

@echo off break off title C:\Windows\system32\cmd.exe cls  :cmd set /p cmd=C:\Enter Command:  %cmd% echo. goto cmd

Example 2: how to run cmd run administrator using script

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”

Comments

Popular posts from this blog

Are Regular VACUUM ANALYZE Still Recommended Under 9.1?

Can Feynman Diagrams Be Used To Represent Any Perturbation Theory?