Thatsgreat2345 Posted February 19, 2006 Share Posted February 19, 2006 Ok i have two questions ive tryed winsetstate to hide the cmd but it doesnt seem to be working and im also trying to figure out how i would encorporate a radio button to choose wheter to add an admin account or just add a regular user account + how could i get the current accounts to display in my edit box to add the account to the admin group the command is net localgroup "Administrators" USERNAME /add Example: net localgroup "Administrators" bob /add expandcollapse popup#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 Run("C:\WINDOWS\system32\cmd.exe") WinSetState("C:\WINDOWS\system32\cmd.exe -","",@SW_HIDE) Send($adduserline & "{enter}") processClose("cmd.exe") case $msg = $Deluserb $a = Guictrlread($deleteuser) $deluserline = ("net user " & $a & " /delete");Ex: net user bob /delete Run("C:\WINDOWS\system32\cmd.exe") send($deluserline & "{enter}") Processclose("cmd.exe") case $msg = $changepassb $abcd = Guictrlread($changepass) $abcde = Guictrlread($changepass) $changepassline = ("net user " & $abcd & " " & $abcde);Ex: net user bob 1234 Run("C:\WINDOWS\system32\cmd.exe") send($changepassline & "{enter}") processclose("cmd.exe") EndSelect Until $msg = $GUI_EVENT_CLOSE Link to comment Share on other sites More sharing options...
GaryFrost Posted February 19, 2006 Share Posted February 19, 2006 why not just RunWait(@Comspec & ' /c ' & $Adduserline,"", @SW_HIDE) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
ChrisL Posted February 19, 2006 Share Posted February 19, 2006 Run ( "C:\WINDOWS\system32\cmd.exe" , "" ,@SW_Hide) I think you could just Run("CMD","",@SW_Hide) [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted February 19, 2006 Author Share Posted February 19, 2006 (edited) why not just RunWait(@Comspec & ' /c ' & $Adduserline,"", @SW_HIDE) thx gafrost worked like a charm now for the radio button or the users i know im gonna have to do a regread HKEY_USERS but yeah Edited February 19, 2006 by thatsgreat2345 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now