Jump to content

User account


Recommended Posts

I am trying to make a script to change the password of the account and then log off. Right now, it is only possible if there is a shortcut to the user control panel on the desktop in the top left hand corner. I want to make it not be dependant on that.

Script:

#NoTrayIcon

$zero = 0
if $zero = 0 then
;sleep(1200000)
ToolTip("You have 20 minutes", 0, 0)
sleep(60000)
ToolTip("You have 19 minutes", 0, 0)
sleep(60000)
ToolTip("You have 18 minutes", 0, 0)
sleep(60000)
ToolTip("You have 17 minutes", 0, 0)
sleep(60000)
ToolTip("You have 16 minutes", 0, 0)
sleep(60000)
ToolTip("You have 15 minutes", 0, 0)
sleep(60000)
ToolTip("You have 14 minutes", 0, 0)
sleep(60000)
ToolTip("You have 13 minutes", 0, 0)
sleep(60000)
ToolTip("You have 12 minutes", 0, 0)
sleep(60000)
ToolTip("You have 11 minutes", 0, 0)
sleep(60000)
ToolTip("You have 10 minutes", 0, 0)
sleep(60000)
ToolTip("You have 9 minutes", 0, 0)
sleep(60000)
ToolTip("You have 8 minutes", 0, 0)
sleep(60000)
ToolTip("You have 7 minutes", 0, 0)
sleep(60000)
ToolTip("You have 6 minutes", 0, 0)
sleep(60000)
ToolTip("You have 5 minutes", 0, 0)
sleep(60000)
ToolTip("You have 4 minutes", 0, 0)
sleep(60000)
ToolTip("You have 3 minutes", 0, 0)
sleep(60000)
ToolTip("You have 2 minutes", 0, 0)
sleep(60000)
ToolTip("You have 1 minute", 0, 0)
sleep(60000)
endif

WinMinimizeAll()

mousemove( 41, 48, 0)
sleep(150)
MouseClick("left", 41, 48, 2)
sleep(1000)
send("{TAB}")
send("{TAB}")
send("{TAB}")
sleep(1000)

send("oldpass")
send("{TAB}")
send("newpass")
send("{TAB}")
send("newpass")
send("{ENTER}")
sleep(100)

send("oldpass")
send("{TAB}")
send("newpass")
send("{TAB}")
send("newpass")
send("{ENTER}")

Shutdown(0)

mousemove( 41, 48, 0)
sleep(150)
MouseClick("left", 41, 48, 2)
sleep(1000)
send("{TAB}")
send("{TAB}")
send("{TAB}")
sleep(1000)

I want to replace the second code with a "run" command.

Edited by imacrazyballoono
Link to comment
Share on other sites

heres a script i never finished your only going to need one line of it ahahha made this back when i used varaibles , and the autoit tags disabled once again

#include <GUIConstants.au3>

; == GUI generated with Koda ==
$Form1 = GUICreate("User Control", 378, 327, 238, 156)
GUICtrlCreateLabel("Delete User", 88, 128, 60, 17)
GUICtrlCreateLabel("Username", 16, 152, 52, 17)
$adduser = GUICtrlCreateInput("", 80, 40, 73, 21, -1, $WS_EX_CLIENTEDGE)
$addpassword = GUICtrlCreateInput("", 80, 72, 73, 21, -1, $WS_EX_CLIENTEDGE)
$Adduserb = GUICtrlCreateButton("Add User", 280, 56, 49, 17)
GUICtrlCreateLabel("Add User", 96, 16, 48, 17)
GUICtrlCreateLabel("Username", 16, 48, 52, 17)
GUICtrlCreateLabel("Password", 16, 80, 50, 17)
$deleteuser = GUICtrlCreateInput("", 80, 152, 73, 21, -1, $WS_EX_CLIENTEDGE)
$Deluserb = GUICtrlCreateButton("Del User", 176, 152, 49, 17)
GUICtrlCreateLabel("Administrator", 176, 48, 64, 17)
$Admin = GUICtrlCreateRadio("Admin", 248, 48, 17, 17)
GUICtrlCreateLabel("Non - Admin", 176, 72, 62, 17)
$Nonadmin = GUICtrlCreateRadio("Admin", 248, 72, 17, 17)
GUICtrlCreateLabel("Change Password", 80, 200, 90, 17)
GUICtrlCreateLabel("Username", 16, 224, 52, 17)
GUICtrlCreateLabel("Password", 16, 256, 50, 17)
$changeuser = GUICtrlCreateInput("", 80, 224, 73, 21, -1, $WS_EX_CLIENTEDGE)
$changepass = GUICtrlCreateInput("", 80, 256, 73, 21, -1, $WS_EX_CLIENTEDGE)
$changepassb = GUICtrlCreateButton("Change", 176, 240, 49, 17)
$Users = GUICtrlCreateEdit("", 248, 120, 113, 201, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetData($Users, "Users")
GUICtrlCreateLabel("Users", 288, 104, 31, 17)
GUISetState(@SW_SHOW)
Do
    
    $msg = GUIGetMsg ()
    Select

Case $msg = $Adduserb
        $abc = Guictrlread($adduser)
    $ab = Guictrlread($addpassword)
    $Adduserline = ("net user " & $abc & " " & $ab & " /add  /expires:never");Ex: net user bob 123456 /add /expires:never
    RunWait(@Comspec & ' /c ' & $Adduserline,"", @SW_HIDE)
    processClose("cmd.exe")
case $msg = $Deluserb
    $a = Guictrlread($deleteuser)
    $deluserline = ("net user " & $a & " /delete");Ex: net user bob /delete
RunWait(@Comspec & ' /c ' & $deluserline,"", @SW_HIDE)
Processclose("cmd.exe")
case $msg = $changepassb
    $abcd = Guictrlread($changepass)
    $abcde = Guictrlread($changepass)
    $changepassline = ("net user " & $abcd & " " & $abcde);Ex: net user bob 1234
    RunWait(@Comspec & ' /c ' & $changepassline,"", @SW_HIDE)
processclose("cmd.exe")
EndSelect
Until $msg = $GUI_EVENT_CLOSE
Edited by thatsgreat2345
Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

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