Jump to content

Recommended Posts

Posted

Hi,

would it be possible to add the windos login system before launching a au3 script.

Right now i only use inputbox with a static password. But i need it to be safer, and also tracking who has used the program.

Thanks in advance

Were ever i lay my script is my home...

Posted

I might have found the answer on my question :lmao:

I will try:

Create a GUI with Username, Password and Domain.

Use that with RunAs (even tough i dont need RunAs)

If RunAs can't login..... argh i just saw this

Otherwise returns 1--regardless of success. (If the login information was invalid, subsequent Run/RunWait commands will fail....)

Were ever i lay my script is my home...

Posted

Can this work?

RunAsSet("admin", @Computername, "adminpassword")
$var=AutoItSetOption ( "RunErrorsFatal", 0 )
; Check if admin is ok
    If $var = 1 Then
        MsgBox(0, "Error", "Wrong Username/Password")
    Exit
EndIf

Were ever i lay my script is my home...

Posted

If $CmdLine[0] > 0 Then
    If $CmdLine[1] = '/close' Then Exit
EndIf

RunAsSet("admin", @Computername, "adminpassword")
$var=AutoItSetOption ( "RunErrorsFatal", 0 )
RunWait(@ScriptFullPath & ' /close')
    If @error Then
        MsgBox(0, "Error", "Wrong Username/Password")
    Exit
EndIf
RunAs does never fail. Only Run/RunWait fails.

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