Hi C.M.G,
there are two (well at least two) possibilities.
One is using the command you mentioned "shutdown"
and the other is using a free Sysinternals utility: PsShutdown
(
http://www.sysinternals.com/Utilities/PsShutdown.html).
The main problem with both utilities is the timeout.
I am almost sure that there is no way to set the logoff timeout with
shutdown (there is supposed to be a way in earlier versions of shutdown, but
I didn't find it) and I could not find a way to "persuade" the PsShutdown to
use the timeout switch with the logoff switch.
So I propose that you use the "at" command to set the time;
The whole command should look something like this:
at 21:00 /interactive /every:M,T,W,Th,F shutdown -l -f
The command will log off a user ever weekday at 9 pm.
The other way to go is with the "soon.exe" utility which you can download
from the following link:
(
http://www.microsoft.com/downloads/...e6-9eef-4975-b51c-8d670748ca8e&displaylang=en)
With "soon" you can set the amount of time after a specific command will
execute.
e.g.
soon /interactive 3600 shutdown -l -f
The command will log off a user after 3600 seconds.
Of course there is a lot of different ways to logoff a user using a command
line or a script. If you are familiar with vbs scripts you can create that
or you can use one of the 3rd party utilities (e.g.
http://www.robvanderwoude.com/shutdown.html) that do exactly what you want.
VBS Example:
'---Start Script
Const LOGOFF = 0
Const SHUTDOWN = 1
Const REBOOT = 2
Const fLOGOFF = 4
Const fSHUTDOWN = 5
Const fREBOOT = 6
strComputer = "."
Set objWMIService = GetObject _
("winmgmts:{impersonationLevel=impersonate,(Shutdown)}\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Sleep 5000
objOperatingSystem.Win32Shutdown(fLOGOFF)
Next
'----End Script
The user will be logged off after 5 seconds.
I hope the mentioned helps and please let us know if this is the information
you were looking for and let me know if anything is unclear in the post.
Regards,
Matija Hrovat