No luck unfortunately

I have added this function

 Code:
function STOPSPOOLER()
	DIM $remotepc,$objservice

	$remotepc=@wksta
	MESSAGEBOX($remotepc,"test")


	$objservice=Getobject("WinNT://" + $remotepc + "/Spooler,Service")
            if @error
              exit -4
            endif

            $objservice.stop
            do
              sleep 0.2
	      ?$objservice.status
            until $objservice.status=1   ;stopped
	    ?$objservice.status
	    
            ;$objservice.start



endfunction


And I get stuck in the do loop. Status reports back as 4. I assume this means running.

Any suggestions on where to go from here or if there is an easier way to start/stop the print spooler?

Thanks again guys
Nick


Edited by Mart (2010-05-21 01:16 AM)
Edit Reason: Please use code tags when posting code.