Sign in to follow this  
Followers 0
AppTux

Read all users on the computer

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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]

Share this post


Link to post
Share on other sites

$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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0