Here’s a quick script to add a user to the local computer in the administrators group and hide the user account from the logon screen. This is intended for Windows XP.  Wrote this after brief research (noted in script) because I needed to add user accounts across multiple computers easily.  Of course, the password is in plain-text, so any savvy computer user could see the password if he/she edited the file instead of running it.  In the long run, I ended up creating a Visual Basic application that does the same thing and used ClickOnce technology to distribute it.

@echo off
: Add local administrator
: Revised January 22, 2010, RJK
:
: Further information: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_user.mspx?mfr=true
: And (net user): http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_user.mspx?mfr=true
: And (net localgroup): http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_localgroup.mspx?mfr=true

net user techsupport p@ssw0rd /add /passwordreq:yes /passwordchg:yes /fullname:"Tech Support" /usercomment:"Tech Support Administrator"
net localgroup "administrators" "techsupport" /add
net localgroup "users" "techsupport" /delete

: Hide logon
reg add "hklm\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /v techsupport /t REG_DWORD /d 0 /f

Note: You must have administrative privileges to add a local user account.


You might also be interested in...