Many thanks for pointers,
When I run the script with my array enabled, it comes with the following error Code:
ERROR : Error in expression: this type of array not supported in expressions.
Script: \\curricsvr1\netlogon\scripts\lock2.kix
Line : 29
Code changes:
Code:
$Computer = ReadFile('\\curricsvr1\netlogon\scripts\computers.txt')
$Service = 'rexesvr'
$objService = Getobject("WinNT://$Computer/$Service,Service")
if @error = 0
$status = $objService.status
select
case $status = 4 ;Running
; do something
Run "Beyondexecv2 \\" + $Computer + " -d Shutdown -l 0"
case $status = 1 ;Stopped
; do something
fADSIServiceRun ($Computer, $Service, 1)
case $status = 7 ;Paused
; do something
fADSIServiceRun ($Computer, $Service, 1)
case 1
? "Unhandled service status(0):$status"
exit (1)
endselect
else
? $Computer
? "Error: " + @error
? " " + @serror
endif
_________________________
Dont worry because a rival imitates you. As long as they follow in your tracks they cant pass you!