Jump to content

Recommended Posts

Posted (edited)

RunAs("test", @ComputerName, "admin", 0, @AutoItExe, @WorkingDir, @SW_SHOWDEFAULT)
RunAs("test", @ComputerName, "admin", 0, "notepad.exe", @WorkingDir, @SW_SHOWDEFAULT)

The first line does not work, but the second does.

I've tried using the older RunAsSet with Run, and I get an error that the directory name is invalid.

EDIT: I tested this line

RunAs("test", @ComputerName, "admin", 0, "cmd /c pause|start " & @AutoItExe, @WorkingDir, @SW_SHOWDEFAULT)
And the command prompt said "Access is denied." Edited by daslick
Posted

You could also try something like this:

If Not IsAdmin() Then
    RunAsSet("USERNAME", @ComputerName, "PASSWORD")
    If @Compiled Then
        Run('"' & @ScriptFullPath & '"')
        Exit
    EndIf
EndIf

[sub]Quantum mechanics: The dreams stuff is made of[/sub]

Posted

Tested. With your code I'm getting an Autoit error

You may need to set a working directory which is valid for access.

RunAs("test", @ComputerName, "admin", 0, '"' & @AutoItExe & '"', @TempDir, @SW_SHOWDEFAULT)

And some quotes may help as well.

:)

Posted (edited)

Has anyone else with Autoit Beta 3.2.11.4 tried this? None of the examples posted here are working for me.

EDIT: I STILL have been unable to find a way to have my script use a RunAs/RunAsSet+Run command on itself with this version of Autoit. Help??

Edited by daslick

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...