alcium Posted October 20, 2006 Share Posted October 20, 2006 HelloI couldn't find a way to do this but maybe a genius could help me here I'm searching a way to Initiate a reboot when a user loggs off in certain conditions onlyThe complete shceme is hereI 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 loginThe 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 runningIf anyone has an idea I'll take it Link to comment Share on other sites More sharing options...
alcium Posted October 20, 2006 Author Share Posted October 20, 2006 (edited) Eheh, time has done it,I've found a way to do this so I thought I'd share it for those who are interestedI use a rebooter in combination with psexec (sysinternals tool) and sleep.exe to go throughMy main logoff script copies the rebooter batch file to windows\temp then calls it with this commandpsexec -d "c:\windows\temp\rebooter.bat"rebooter.batIF (%1)==() goto relaunchgoto doreboot:relaunchpsexec -d c:\windows\temp\rebooter.bat trucgoto eof:dorebootsleep 15shutdown -r -t 00 -f:eofexitOf 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 Edited October 20, 2006 by alcium Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now