Jump to content

Read all users on the computer


AppTux
 Share

Recommended Posts

I want to make a program to add or remove users.

Is it possible to read all the users from the computer and set it in a combo? :mellow:

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
Link to comment
Share on other sites

Hi,

Yes this can be done in AutoitScript.

Some idea for you.

RunWait("cmd.exe /c " & "wmic useraccount get Name>>"&@TempDir&"\localusers.ini",@ScriptDir,@SW_HIDE)
MsgBox(64,"",FileRead(@TempDir&"\localusers.ini"))

+

for add users to localgroups or delete you can use standart windows

net user /?

and use it with

run()

I believe you can find more new ideas for self.

Edited by Sh3llC043r
[size="5"] [/size]
Link to comment
Share on other sites

  • Developers

$oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler 
Local $objDomain = ObjGet("WinNT://" & @ComputerName & "" )
Dim $filter[2] = ["user"]
$objDomain.Filter = $filter

For $aUser In $objDomain
   ConsoleWrite($aUSer.Name & "|" & $aUSer.Description & @LF)
Next

;COM Error function
Func ComError()
    If IsObj($oMyError) Then
        $HexNumber = Hex($oMyError.number, 8)
        ConsoleWrite($oMyError.scriptline & '  $HexNumber = ' & $HexNumber & "Windescription is: " & $oMyError.description & "|" & $oMyError.windescription  & @lf) ;### Debug Console
        SetError($HexNumber)
    Else
        SetError(1)
    EndIf
    Return 0
EndFunc   ;==>ComError

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

thank you very much.

this was very helpful! :mellow:

PowerSlide2UnlockiPhone look-a-like program you can use to lock your pc, you can't access your desktop again until the password is entered and the slider slided to the right. (really proud of it)-- After a time AutoIt and Windows, I switched to Mac. Don't expect me to answer anymore.
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...