cypher175 Posted December 24, 2008 Share Posted December 24, 2008 Is there any way to check if a registry key is installed in the registry and if its not found to be installed then have it installed..?? And also is there anyway for autoit read/determine what the current users HKEY_USERS\User ID is so it can install a reg key that corresponds to it..?? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 24, 2008 Developers Share Posted December 24, 2008 Have you checked the Helpfile for RegRead() and the possible @Error codes? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
cypher175 Posted December 24, 2008 Author Share Posted December 24, 2008 ok thanks, but what about my 2nd question..?? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 24, 2008 Developers Share Posted December 24, 2008 The current users Hive is loaded in the HKEY_CURRENT_USER hive so why not use that? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
cypher175 Posted December 24, 2008 Author Share Posted December 24, 2008 well how can i use autoit to determine the user ID for the HKEY_USERS\User ID key..?? Link to comment Share on other sites More sharing options...
Developers Jos Posted December 24, 2008 Developers Share Posted December 24, 2008 This is a script which will retrieve the SID for Local defined user and can be used for the registry key: ConsoleWrite(GetUserSID(@ComputerName,@UserName) & @CRLF) Func GetUserSID($ComputerName,$Username) Dim $UserSID, $oWshNetwork, $oUserAccount $objWMIService = objGet( "winmgmts:{impersonationLevel=impersonate}!//" & $ComputerName & "/root/cimv2") $oUserAccounts = $objWMIService.ExecQuery("Select Name, SID from Win32_UserAccount") For $oUserAccount In $oUserAccounts ;~ ConsoleWrite('$oUserAccount.SID = ' & $oUserAccount.SID & @crlf) ;~ ConsoleWrite('$oUserAccount.name = ' & $oUserAccount.Name & @crlf) ;~ ConsoleWrite('$oUserAccount.domain = ' & $oUserAccount.Domain & @crlf & @CRLF) If $Username = $oUserAccount.Name Then Return $oUserAccount.SID Next Return "" EndFunc SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
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