Skip to content
⌘ NSIS Forum Archive

Find local user account

4 posts

coopey247#

Find local user account

I need to determine whether or not a computer has a local account with a specific name, ie "Manage". Any ideas?
deguix#
You means computer user with name "Manage"? If YES, have in the HKU key the users available in the computer, so:

EnumRegKey $0 HKU "Manage" "0"
StrCmp $0 0 NoManage
  #Enter the code to run when have a user with the name Manage
NoManage: 
If NO, sorry, I can't help.
coopey247#
Thanks for the help. I just ended up doing a net user > c:\user.txt and then parsed through that file to see if the local user existed. Thanks.