Solved

Programmatically Log In to Windows XP

Posted on 2004-09-12
8
1,885 Views
Last Modified: 2007-12-19
I would like to be able to programmatically log in to my Windows XP machine. For example, I'd like to write a program that would say at 7:55 AM the program would log in to my machine and I would see the desktop NOT the log on to windows dialog.

I need help with how do I do this and how do I do this with C# in .NET?
0
Comment
Question by:CJCraft
  • 2
  • 2
8 Comments
 
LVL 22

Expert Comment

by:cookre
Comment Utility
If it's just for you and you have a fairly recent BIOS, set the BIOS to boot at the specified time, then use TweakUI to do the auto logon.  Otherwise, the task scheduler would be the way to go:
http://www.experts-exchange.com/Security/Win_Security/Q_20918757.html
0
 
LVL 7

Author Comment

by:CJCraft
Comment Utility
Thanks cookre,

Actually, the point of the program is to log in to the machine from a program.

Think of a USB token that you use connect to a PC then it autoruns an application that logs you on.

I want to write a program that will log on on for me in the same sense.
0
 
LVL 18

Assisted Solution

by:armoghan
armoghan earned 250 total points
Comment Utility
Just a guess and a start
You can try making a windows service which runs at the back ground and send specific key strokes to the windows login screen
0
 
LVL 22

Accepted Solution

by:
cookre earned 250 total points
Comment Utility
If the machine is off, you'll have to set a boot time in CMOS setup (if you have it).

If a user is already logged in, the service will have to do a logout, then an EnumDesktops to get a handle to the logon desktop, open the desktop then EnumDesktopWindows to get a handle to the logon window, from which you can use PostMessage to send keys to it.
0
 
LVL 18

Expert Comment

by:armoghan
Comment Utility
My Comment
You can try making a windows service which runs at the back ground and send specific key strokes to the windows login screen

Elaborated by cookre

If a user is already logged in, the service will have to do a logout, then an EnumDesktops to get a handle to the logon desktop, open the desktop then EnumDesktopWindows to get a handle to the logon window, from which you can use PostMessage to send keys to it.


Should I get some points ?
I would suggest a split
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now