Jump to content

Recommended Posts

Posted (edited)

How can I run cmd file as an administrator in the folder I am in?
I have tried all of the following possibilities.

#RequireAdmin
;~ $CmdPath = @ScriptDir & "\Test.cmd"
;~ Run(@ScriptDir & "\Test.cmd")
;~ Run(@ComSpec & " /k " & $CmdPath ,@ScriptDir)
;~ ShellExecute(@ComSpec ," /k " & $CmdPath ,@ScriptDir)
;~ ShellExecute(@ScriptDir & "\Test.cmd")
;~ ShellExecute($CmdPath, "", "", "runas")
;~ ShellExecute($CmdPath, "", @WorkingDir, "runas")
;~ RunAs("USER", @ComputerName, "", "", $CmdPath, @ScriptDir, "", @SW_SHOWMAXIMIZED)

mY9skkmERFu9JnJSKO6zLA.png

Edited by youtuber
Posted (edited)

Not a title, Test.cmd file in the working folder I am in and I want to run it in Admin authority.

zthCh5l_R3aMnO75A1BGXQ.png

As seen here

wh6yfP22T0Srq8upqdPpew.png

Edited by youtuber

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...