Sign in to follow this  
Followers 0
HockeyFan

Please Help....

3 posts in this topic

:evil:

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.

Share this post


Link to post
Share on other sites



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.

 

Share this post


Link to post
Share on other sites

Thanks gafrost...that worked for me. I appreciate the help. Thanks again. :)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0