HockeyFan Posted July 8, 2005 Share Posted July 8, 2005 Please help!! I have a script that is using the RegWrite function to add seven entries into a Windows XP Pro SP1 registry. An example of the code is... RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", "Homer") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultUserName", "REG_SZ", "Homer") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") When I execute the script it does not populate the regisrty at all. I am using the RunAsSet command to give administrative rights but when the the script is run, the user has only Power User rights. I can get the script to work if I elevate the user to administrator, but we can't do that for everyone that is going to run this script. Could someone please explain to me why the RegWrite function won't work even when the RanAsSet command is evoked at the beginning of the script? Everything else works fine. The above registry entries work if I refernece a reg file instead of using the RegWrite function. WHY??? Can multiple RegWrite commands be used one after the other? Or does that create a coding problem? Any Help would be much appricated. Link to comment Share on other sites More sharing options...
GaryFrost Posted July 8, 2005 Share Posted July 8, 2005 Try something like the following Main Program: RunAsSet("User","domain","password") RunWait(@ScriptDir & "\SetReg.exe","",@SW_HIDE) RunAsSet() SetReg script to be compiled RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "DefaultUserName", "REG_SZ", "Homer") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AltDefaultUserName", "REG_SZ", "Homer") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "AutoAdminLogon", "REG_SZ", "1") SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
HockeyFan Posted July 12, 2005 Author Share Posted July 12, 2005 Thanks gafrost...that worked for me. I appreciate the help. Thanks again. 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