Jump to content
Sign in to follow this  
rods

Local user account management

Recommended Posts

rods

Hi, Does somebody has any example or description of how to enable/disable a local user account?

Share this post


Link to post
Share on other sites
PsaltyDS

Search button broke?

All seriousness aside, that one's been done to death, and it should be easy to find examples to try.

:mellow:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites
platypoos

run("cmd")

sleep(150)

send("net user USERNAME /active:no)

sleep(150)

send("{enter}")

sleep(250)

send("exit")

send("{enter}")

exit

IF you want to make the username active put yes on the 3rd line.

Share this post


Link to post
Share on other sites
PsaltyDS

@platypoos: Knock that off. No more examples involving Send() with a CMD console. It's poor usage, bad practice, and shouldn't be spread around. You can do better.

If you want to run that, then:

$sUserName = "YourUserName"
$sActive = "NO" ; use "NO" or "YES"
$iRET = RunWait("NET USER " & $sUserName & " ACTIVE:" & $sActive)
MsgBox(64, "Done", "Return code = " & $iRET)

:mellow:

Edited by PsaltyDS

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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  

×