Something like this?
Code:
dim $iRC
; set restrictive script settings
$iRC=SETOPTION('Explicit','on')
$iRC=SETOPTION('NoVarsInStrings','on')
dim $asCompList, $sComp
$asCompList=NetView2()
? 'Shutting down '+ubound($asCompList)+' computers'
for each $sComp in $asCompList
if $sComp<>@WKSTA
? 'Shutting down '+$sComp
$iRC=SHUTDOWN ($sComp, 'Scheduled network-wide computer shutdown', 10, 1, 0)
endif
next
$sComp=@WKSTA
? 'Shutting down '+$sComp
$iRC=SHUTDOWN ($sComp, 'Scheduled network-wide computer shutdown', 10, 1, 0)
exit 0