Improved to exclude certain comps, remove the first three lines if used with Task Scheduler, or keep them as safety measure.

code:
$TimeofDay = val(split(@TIME,':')[0])
if $$TimeofDay<22 or $TimeofDay>23
exit 0
endif
$excluded='comp1','comp2','comp3',@wksta
$comps=netview2()
for each $comp in $comps
if ascan($excluded,@WKSTA)=-1
$rc=shutdown($comp,'"Shutdown in 30 Seconds',30,1,2)
if @error
$offline=$offline+1
else
$online=$online+1
endif
endif
next
? 'Computers already offline :'+$offline
? 'Computers online (SHUTDOWN) :'+$online
$rc=shutdown(@WKSTA,'"Shutdown in 30 Seconds',30,1,2)
exit 0



[ 02. October 2003, 14:47: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.