Jump to content
Sign in to follow this  
tommykx

service to login

Recommended Posts

tommykx

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?

Share this post


Link to post
Share on other sites
tommykx

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...

Share this post


Link to post
Share on other sites
tommykx

Thank you... may be is the solution but i'm running as a service... can i use it in this case?

Share this post


Link to post
Share on other sites
tommykx

So you think that there's no solution?

Share this post


Link to post
Share on other sites
Chimp

if win7 is x64 then registry key names are different from x86

have a look >here or >here

Edited by PincoPanco

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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  

×