Jump to content

service to login


tommykx
 Share

Recommended Posts

Hi all. I'm new in autoit.

I've write a service that check if a user i logged or not.

If not the script write some reg for autologin and reboot.

This work perfectly in xp but not in win7. I think that is a limit adding reg entry.

Someone know how to?

Link to comment
Share on other sites

Thnk you JohnOne.

The code i use to write reg is:

Func AutoLogon($usernameFn, $passwordFn = "");Write autologon information to registry
    Local $tempRegkey = "HKLM\Software\Microsoft\Windows NT\CurrentVersion\WinLogon"
    RegWrite($tempRegkey, "DefaultUserName", "REG_SZ", $usernameFn)
    RegWrite($tempRegkey, "DefaultPassword", "REG_SZ", $userPasswordFn)
    RegWrite($tempRegkey, "AutoAdminLogon", "REG_SZ", "1")
    ;RegWrite($tempRegkey, "AutoLogonCount", "REG_DWORD", "1")
    RegWrite($tempRegkey, "DefaultDomainName", "REG_SZ", @ComputerName)
EndFunc  ;==>AutoLogon

i've tryed also with a bat file "RunAs" a machine user (admin) but with no effect...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...