I want to fire off a one-time scheduled task at login for a particular user that forces them to logoff in 30 minutes from their login. I've been trying various approaches with the SCHTASKS command but am not having any luck getting it to work from Kix. The Kix script is below, with the BAT file code below that. The BAT file works fine by itself.
Code:
Break ON
$=MessageBox("Configuring Automatic Logoff...","Network Security",64,2)
Shell "%COMSPEC% /C schtasks /delete /tn AutoLogoff /f"
Shell "%COMSPEC% /C schtasks /create /sc minute /mo 30 /u System /tn AutoLogoff /tr \\utopia\netlogon\autologoff.bat"
Return
BAT file AUTOLOGOFF.BAT
Code:
@echo off
title Forced Automatic Logoff
echo You are now required to logoff in 30 seconds...
echo *** bye bye ....
shutdown -l -f -t 30
Does anyone know of a better way to do this? Am I leaving something out?
_________________________
silence is golden, but duct tape is silver