Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/01/2013 in all areas

  1. leke, Welcome to the AutoIt forum. Take a look at the ChooseFileFolder UDF in my sig - it will allow you to create exactly what you want. M23
    1 point
  2. TheSaint

    Why won't this work?

    All up, you would be better off assigning what you read, to variables. Case $Button1 $val_1 = GUICtrlRead($Input1) $val_2 = GUICtrlRead($Input2) If $val_1 > $val_2 Then MsgBox(0,"Test", "Greater") ElseIf $val_1 < $val_2 Then MsgBox(0,"Test", "Smaller") Else MsgBox(0, "Test", "Equal") EndIf
    1 point
  3. Jos

    ...

    Here you have something to play with: Init objects $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler $UserName = 'Fred' $Password = 'Wilma123' $strComputer = @ComputerName ;*********************** ;Create UserID $colAccounts = ObjGet("WinNT://" & $strComputer & "") $objUser = $colAccounts.Create("user", $UserName) $objUser.SetPassword ($Password) $objUser.Put ("Fullname", "Test User") $objUser.Put ("Description", "Test User description") $objUser.Put ("PasswordExpired", 1) ;expire the password $objUser.SetInfo ;*********************** ;Add User to group $objGroup = ObjGet("WinNT://" & $strComputer & "/Administrators,group") $objGroup.Add($objUser.ADsPath) ;*********************** ; Rename User $colAccounts = ObjGet("WinNT://" & $strComputer & "") $objUser = $colAccounts.Create("user", $UserName) $OldUser = "Fred" $NewUser = "Fredrenamed" $oUser = ObjGet("WinNT://" & @ComputerName & "/" & $OldUser & ",user") $oComputer = ObjGet("WinNT://" & @ComputerName) $oNewUser = $oComputer.MoveHere($oUser.ADsPath, $NewUser) ; Delete User $colAccounts = ObjGet("WinNT://" & $strComputer & "") $objUser = $colAccounts.Delete("user", $NewUser) Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _ "Number is: " & $HexNumber & @CRLF & _ "Linenbr is: " & $oMyError.scriptline & @CRLF & _ "Description is: " & $oMyError.description & @CRLF & _ "Windescription is: " & $oMyError.windescription ) SetError(1) ; something to check for when this function returns Endfunc You can pull the startup username from the registry.' So, What is you goal here? Why rename the userid? Jos
    1 point
×
×
  • Create New...