How to accomplish an autologon

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
dboyd
Newbie
Posts: 3
Joined: Tue May 23, 2006 6:21 pm

How to accomplish an autologon

Post by dboyd » Tue May 23, 2006 6:31 pm

I am trying to find a way to duplicate the functionality of the Windows registry entry ForceAutoLogon. That entry will force Windows to log back in as soon as the user logs out. However, that process happens very quickly and for various reasons, I need to slow it down.

I am using another application that, as part of its design, will log out of Windows when the users exits the program. At that point, I need to pause about 5 -7 seconds and then have the workstation automatically log back in.

I thought I could do that with Macro Scheduler's Autologon feature, but can't quite work it out.

As I envision it, the script would run (via Macro Scheduler Service?) when Windows logs out, would wait 5-7 seconds, and then log back into Windows. After that, it would finish. I don't need anything else to happen.

Any ideas? Thank you for your assistance.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue May 23, 2006 7:21 pm

Macro Scheduler's AutoLogon feature is designed to enable scheduled macros to log into Windows, if Windows is already logged out when the macro is scheduled, run the macro and then log out again. So a macro needs to be scheduled in order to log on automatically.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

dboyd
Newbie
Posts: 3
Joined: Tue May 23, 2006 6:21 pm

Post by dboyd » Tue May 23, 2006 9:30 pm

So if I understand you correctly, Autologon will log into Windows (using whatever credentials are supplied), run the Macro and log out of Windows. Is that right?

So, it looks like I won't be able to use Autologon for the purpose that I'm looking for. That is, after a logout, pause for 5-7 seconds and then log the user back in. At a minimum, I would like to simply cause the Return key to be pressed when the login screen appears (after the delay), since the user name will already be in the the name field.

Any ideas how to accomplish this?

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 24, 2006 6:37 am

Ok, well, download the following file:
http://www.mjtnet.com/software/DoLogon.zip

In this zip file is a command line program called DoLogon.exe which allows you to trigger the AutoLogon service to perform an AutoLogon. Use it like this:

DoLogon.exe username password

So you could run this from a script and build the delay into the script before it.

You'd need to schedule the script and have the Scheduler Service running so that it can run while you're logged out. Disable AutoLogon from macro properties as the script itself is now performing the log in.

Not sure how you'd run a script 5-7 seconds after logging out however. Since you're logged out you can't really run anything without scheduling it. A service can be running when you're logged out, but it would have to already be running. Perhaps you can create a compiled script and install it as a service and have this script exit the application which performs the log out, wait 5 seconds and then perform DoLogon.exe. To run the script you'd have to start it's service. To install an EXE as a service see here:

http://www.mjtnet.com/msfaq6_old.htm

You can start services from a script with:

Run>net start servicename
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

dboyd
Newbie
Posts: 3
Joined: Tue May 23, 2006 6:21 pm

Post by dboyd » Wed May 24, 2006 1:23 pm

If the Scheduler service is running, could the script be triggered by the appearance of the Windows Logon Screen? "Log On to Windows", or does the script actually have to be "scheduled" at a particular time?

If it could be triggered by the appearance of that window, it shouldn't be difficult for the script to provide the credentials and press the Return key.

Thank you.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Wed May 24, 2006 3:41 pm

No that won't work because the scheduler service cannot see the login window - it is not running under the login desktop.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts