Discussion Locked

Stop users closing the logon script

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Anyone know a handy way (apart from casual workplace violence) of stopping users from prematurely closing down their logon scripts?

e.g. a command at the beginning of the script to reboot the machine in x seconds if a counter command (at the end of the script) is not run.

5 replies

by timthetoolman

Hi,

Its a bit clunky and subject to hacking if the user knows what to do, but you could do an "at" command as the first line of the script to run a batch file in say 1 min that does a "logoff" if a flag file wasn't found... and then delete the flag file.

The logon script obviously creates the flag file at the end...

The tricky bit of this is to calculate the time for the "at" command to run at.

E:\Documents and Settings\Tim Medhurst>time /t
03:16 AM

E:\Documents and Settings\TimMedhurst>time /t > temp.txt

E:\Documents and Settings\Tim Medhurst>for /F "tokens=1,2 delims=: " %i in (temp
.txt) do echo %i %j

E:\Documents and Settings\Tim Medhurst>echo 03 16
03 16

...returns the hours and minutes. Obviously you need to add two to the minutes and recalculate for overflows, but I dont want to leave nothing for you to do...;-)

Cheers,
Tim.

This discussion is closed to new replies.