Pook Posted May 23, 2007 Share Posted May 23, 2007 I'm not 100% sure how to use the RegRead command. If the main key below doesn't exist or just doesn't have a value Then how would you make the script check a different Reg key? *kinda like a If/Else command in Vbscript (main Key) $username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon','AltDefaultUserName') (back-up Key) $username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration','UserName') Link to comment Share on other sites More sharing options...
Developers Jos Posted May 23, 2007 Developers Share Posted May 23, 2007 Test for the @error value as described in the Helpfile.. 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...
Gif Posted May 23, 2007 Share Posted May 23, 2007 I'm not 100% sure how to use the RegRead command. If the main key below doesn't exist or just doesn't have a value… Then how would you make the script check a different Reg key? *kinda like a If/Else command in Vbscript (main Key) $username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon','AltDefaultUserName') (back-up Key) $username = RegRead('\\'& $PC & '\HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Real Time Scan Configuration','UserName') what's the problem ? (post the part of script that does not func right) RegRead ( "keyname", "valuename" ) example: $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir") MsgBox(4096, "Program files are in:", $var) Link to comment Share on other sites More sharing options...
Developers Jos Posted May 23, 2007 Developers Share Posted May 23, 2007 what's the problem ? (post the part of script that does not func right)I think the OP's question its clearly defined ... 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...
Gif Posted May 23, 2007 Share Posted May 23, 2007 I think the OP's question its clearly defined ... ok Return Value Success: Returns the requested registry value. @EXTENDED is set to the type of the value $REG_... . These types are defined in the "Constants.au3" include file. Failure: Returns "" and sets the @error flag: 1 if unable to open requested key 2 if unable to open requested main key 3 if unable to remote connect to the registry -1 if unable to open requested value -2 if value type not supported 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