Jump to content

Is it possible to automate Log off then log on, as an Administrator?


Recommended Posts

Hi, I'm a novice here, sorry if i haven't done enough search&read.

I found out that log off could be automate with shutdown(20), but not sure how to automate logon after that.

As I couldn't manage to find the command, also I'm not sure if the process of AutoIt's script will be killed when logging off.

If there's a clue or example exists, please suggest.

Link to comment
Share on other sites

Hi, I'm a novice here, sorry if i haven't done enough search&read.

I found out that log off could be automate with shutdown(20), but not sure how to automate logon after that.

As I couldn't manage to find the command, also I'm not sure if the process of AutoIt's script will be killed when logging off.

If there's a clue or example exists, please suggest.

sysinternals has an autologon utility that installs as a service -- you could conceivably write code to install / uninstall activate / deactivate its functionality.

Addendum -- if you pursue this, please post results or problems / issues -- curious to see what you come up with.

Edited by flyingboz

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

sysinternals has an autologon utility that installs as a service -- you could conceivably write code to install / uninstall activate / deactivate its functionality.

Addendum -- if you pursue this, please post results or problems / issues -- curious to see what you come up with.

Create these regkeys

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinLogon

DefaultUserName: REG_SZ

DefaultPassword: REG_SZ

AutoAdminLogon: REG_DWORD

Link to comment
Share on other sites

Hi, Thank you for your responses, but let me clarify what I'd like the code to do in steps:

After running the script:

1. Open a program, do some tasks, save and close.

2. Log off.

3. Log on.

4. Open a program, do some tasks, save and close.

5. Log off.

6. Log on.

7

8

n

Here, the problem is I don't know how, or is it possible, to have the code continue running to log on, after, the code itself has performed to log off the system.

Edited by kacharuk
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...