this-is-me Posted July 20, 2004 Posted July 20, 2004 I need to have my au3 script set up an autologon only if there is more than one user that logs on to the system. How can I find out from the registry only if there is more than one user? What keys or values do I look for to find out what users are available? Who else would I be?
this-is-me Posted July 20, 2004 Author Posted July 20, 2004 I don't want to use net user. That is why I asked for a registry only method. Did you even read the whole post? Who else would I be?
Holger Posted July 20, 2004 Posted July 20, 2004 (edited) what is with:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList?You query it with RegEnumKey and read then OptimizedLogonStatusThis seems only to exist on 'normal' profiles.Maybe the Flags-entry is special for 'normal' profiles, at my pc it's only "0" for these.For other profiles it is 9 and 12 here...Edit: or you check the length of the RegEnumKey-Key.... Edited July 20, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
this-is-me Posted July 20, 2004 Author Posted July 20, 2004 (edited) I think 12 is system and 9 is service. Each normal user is 0, and I think you gave me the info I needed. Edited July 20, 2004 by this-is-me Who else would I be?
Holger Posted July 20, 2004 Posted July 20, 2004 (edited) Yeah, maybe thats only what you need...cause at my PC there are only profiles in this list which have a real personal folder you know (after logon)... Edited July 20, 2004 by Holger Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
Carlos Posted July 20, 2004 Posted July 20, 2004 What meanedwith the OptimizedLoginState I have values of 5,10 and 11
Holger Posted July 20, 2004 Posted July 20, 2004 @Carlos: we mean the 'Flags'-value in the subkeys. Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView
this-is-me Posted July 21, 2004 Author Posted July 21, 2004 Completed scrap - Purpose is to check existance of more than one user on 2000/XP besides the admin account. $num = 1 $tot = 0 While 1 $k = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList", $num) if @error then exitloop if StringInStr($k, "S-1-5-21-") Then $m = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\" & $k, "ProfileImagePath") if not @error then if not StringInStr($m, "Administrator") then $tot = $tot + 1 if $tot >= 2 then msgbox(0,"","More than one user...") ExitLoop EndIf EndIf EndIf EndIf $num = $num + 1 wend Who else would I be?
Triton Posted July 21, 2004 Posted July 21, 2004 (edited) Hey I just noticed something if you look at the code it looks like a pistol! A 9mm to exact. I also noticed that in the subkeys that there is a binary value named state which in my reg (xp sp2) value 0x00000000 is for a service and a value of 0x00000256 was for an actual user. Just somethin I noticed and don't know if it will make things easier. Edited July 21, 2004 by Triton Triton
this-is-me Posted July 21, 2004 Author Posted July 21, 2004 Maybe that guy in your avatar can use it... Who else would I be?
Triton Posted July 21, 2004 Posted July 21, 2004 Yes, some days I do need it to shoot my co-works! Triton
Davman Posted July 21, 2004 Posted July 21, 2004 rofl... ok, next coding challenge... make some (working) code, that does something usefull, appear to look like a smiley face. Sitting comfortably behind the code.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now