Jump to content

Unlock Windows 7 Programmatically


agsg

Recommended Posts

Hi,

I need to unlock windows 7 programmatically.(provided I have username/password etc and other required credentials)

Could anyone provide me some hint to do so.

I have to unlock the local PC (windows 7) and show user desktop.

I had already done this with Window XP and now want to do it on Win 7.

Link to comment
Share on other sites

Is the computer you are trying to get in, locked by another user already logged on, or you don't know what the password is and want to get it?

Link to comment
Share on other sites

Is the computer you are trying to get in, locked by another user already logged on, or you don't know what the password is and want to get it?

No, Its my own PC with my user account.

Probably I myself would have locked it or its locked programmatically.

I know the username, password, domain etc.

Link to comment
Share on other sites

No, Its my own PC with my user account.

Probably I myself would have locked it or its locked programmatically.

I know the username, password, domain etc.

Do you receive any error, when trying to login?

Edit: I am just trying to determine what error you are receiving? Cause if your account is really locked out, you could use some live Linux distribution CDs to boot your computer off it and unlock the account.

Edited by Infiltrator
Link to comment
Share on other sites

Do you receive any error, when trying to login?

Edit: I am just trying to determine what error you are receiving? Cause if your account is really locked out, you could use some live Linux distribution CDs to boot your computer off it and unlock the account.

HI Infiltrator,

there is no problem with my account. I can manually unlock it if I like.

Its just that I want to build an application that can automatically unlock a Win7 PC after 5 min.

I have done this in VC++ for Win XP.

I need help in doing it on Win 7.

If u can provide any link or suggestions to do so then it would be of great help.

Please NOTE :

My win 7 setup works fine. No problem with my account whatsoever.

This thread is to ask for suggestions to unlock Win 7 automatically via some programming language code.

Link to comment
Share on other sites

You can use Windows group policy to set the duration of how long an account can remain locked out, before it automatically unlocks itself.

These articles should help you out.

http://technet.microsoft.com/en-us/library/cc739109(WS.10).aspx

http://windows.evaguide.com/2010/02/group-policy-account-lockout-duration.html

Link to comment
Share on other sites

You can use Windows group policy to set the duration of how long an account can remain locked out, before it automatically unlocks itself.

These articles should help you out.

http://technet.microsoft.com/en-us/library/cc739109(WS.10).aspx

http://windows.evaguide.com/2010/02/group-policy-account-lockout-duration.html

HI

Thanks for ur reply.

But, I want to do this unlock stuff programatically.

I want to built it as an application.

The application will implement a security feature based on bluetooth range.

once my bluetooth device is not in range then my system is locked/logoff, once my device comes in range then i want to unlock my workstation without entering the password by user.

Link to comment
Share on other sites

HI

Thanks for ur reply.

But, I want to do this unlock stuff programatically.

I want to built it as an application.

The application will implement a security feature based on bluetooth range.

once my bluetooth device is not in range then my system is locked/logoff, once my device comes in range then i want to unlock my workstation without entering the password by user.

A correction to above reply.

The application will implement a security feature based on bluetooth range.

once my bluetooth device is not in range then my system is locked/logoff, once my device comes in range then i want to unlock my workstation without entering the password by user. username/password will be provide via code.

Link to comment
Share on other sites

I like your idea and in fact Microsoft has an utility called Autologon that records your username and password to a file and basically the next time your machine is started, it automatically logs you in. It does not prompt you for the credentials.

You could use that along with your program/application to unlock your computer when its in range with your bluetooth device. The moment you walk away from your computer, you could use a dos command such as "rundll32.exe user32.dll, LockWorkStation" to lock your computer screen.

That is just an idea.

Edited by Infiltrator
Link to comment
Share on other sites

I like your idea and in fact Microsoft has an utility called Autologon that records your username and password to a file and basically the next time your machine is started, it automatically logs you in. It does not prompt you for the credentials.

You could use that along with your program/application to unlock your computer when its in range with your bluetooth device. The moment you walk away from your computer, you could use a dos command such as "rundll32.exe user32.dll, LockWorkStation" to lock your computer screen.

That is just an idea.

I believe you can do the reverse, but in windows 7, you might get a UAC prompt while the screen is locked and not be able to respond to it. Probably a PowerShell command to do it these days, since a lot of stuff in PowerShell can bypass UAC all together. Dave kennedy even has a way to make the system dump windows keys via PowerShell and some shell scripting. He might know a way to do what you ask, hit him up on twitter @dave_rel1k

Link to comment
Share on other sites

HI Infiltrator,

The Autologon stuff did not worked on domain based computer although it worked on an independent computer.

There is one other thing, I want to make my application as an installer and preferably a window service running in background.

Autologon requires a user to do the settings.

In winXP , I made it work by simulating Alt+ctrl+del and then passing in password but it didn't work in Win 7.

and its nice to see more suggestions coming on this thread :)

Edited by agsg
Link to comment
Share on other sites

Did you try contacting that Guy that Digip recommended you to contact?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

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