Jump to content

Auto Reboot after logoff


alcium

Recommended Posts

Hello

I couldn't find a way to do this but maybe a genius could help me here :D

I'm searching a way to Initiate a reboot when a user loggs off in certain conditions only

The complete shceme is here

I have a script that set Windows 3GB mode on when logging on some partical Users (domain policy)

Once 3GB mode is active computer reboots and log on automatically with the same user name.

What I would like is to make the computer reboot automatically when this user loggs off, and the computer was not set to 3GB mode before first login

The matter is that it seems the logoff process is recognized as a "shutdown" option by Windows,

So VBScript reboot and Shutdown commands can not run since a "shutdown" procedure is already running

If anyone has an idea I'll take it

Link to comment
Share on other sites


Eheh, time has done it,

I've found a way to do this so I thought I'd share it for those who are interested

I use a rebooter in combination with psexec (sysinternals tool) and sleep.exe to go through

My main logoff script copies the rebooter batch file to windows\temp then calls it with this command

psexec -d "c:\windows\temp\rebooter.bat"

rebooter.bat

IF (%1)==() goto relaunch
goto doreboot
:relaunch
psexec -d c:\windows\temp\rebooter.bat truc
goto eof
:doreboot
sleep 15
shutdown -r -t 00 -f
:eof
exit

Of course it's not a really clean way to do it, but it works...

Psexec completely detach the rebooter batch from the logoff process, so finishing the logoff does not kill the batch, and once logoff is finished, shutdown command is accepted at last ...

a whole day to find this trick, but now it's available to everyone :D

Edited by alcium
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
  • Recently Browsing   0 members

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