AutoLockWorkstation


So, my daughter has this knack for pushing past the time she's supposed to stop using the computer. Using a cron entry under Cygwin, I run "wscript autolock.vbs" at 9:00 Sunday-Thursday and 11:00 Friday-Saturday. autolock.vbs contains:

 

On Error Resume Next
Set objShell = CreateObject("Wscript.Shell")
objShell.Run "%windir%System32rundll32.exe user32.dll,LockWorkStation"

Note: This works on Windows 2000. It probably works on other Win32s as well.

 

-Attribution