; add user accounts ; Author - MHz _NetUser('Jack', 'pw_abc') _NetUser('Jill', 'pw_def') Func _NetUser($name, $password = '', $groupname = 'Administrators', $autologon = 0) ; Creates user accounts. Only 1 user can have autologon, if set. Local $key If Not FileExists(EnvGet('AllUsersProfile') & '\..\' & $name) Then RunWait(@ComSpec & ' /c ' & _ 'Net User ' & $name & ' ' & $password & ' /add &&' & _ 'Net LocalGroup ' & $groupname & ' ' & $name & ' /add &' & _ 'Net Accounts /MaxPwAge:UnLimited', '', @SW_HIDE) If $autologon Then $key = 'HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon' RegWrite($key, 'DefaultUserName', 'Reg_sz', $name) RegWrite($key, 'DefaultPassword', 'Reg_sz', $password) RegWrite($key, 'AutoAdminLogon', 'Reg_sz', 1) EndIf EndIf EndFunc
8)




This topic is locked




