Code:
call "tcLib.kxf"

tcInit(1)

  ; just disable each PC on network
    $Task = "FSPinstall"


$ThisMyArray = "PC1", "PC2, "PC3"

For Each $Element In $ThisMyArray

	  tcGetEvent($Element, $Task)  ; load the bad task data
          tcDefineTask("SUS=0")       ; set it to Suspend (disable = 1, enable = 0)
          tcSetEvent($Element, $Task)  ; update the task on the target
         
	  IF @ERROR <> 0
	       $RC = REDIRECTOUTPUT (failure.txt, 0)
	       ? $Element
	  Else if @ERROR = 0
	        $RC = REDIRECTOUTPUT (success.txt, 0)
	       ? $Element
	  Endif Endif


 Next



Sorry, here it is and it works slick like (Glenn thanks). But it gives false positives and false negatives. I have this same error handling scheme for shell commands in Kixtart and it handles them correctly; I have tested it ushering failures to failure.txt and successes to success.txt. Could you explain a bit more on why (Glenn please)the errors traps are hit and miss. I think I understand what you say; can you detail it a bit more? Thanks
so much to you all for you help!
Thanks Jooel! Yeah, it is hard without entire code.

I made this cause i didnt want to go to each workstation behind the scense just to disable this task; script worked slick did what could have taken 1 hour took only 3 minutes! bam!!!!!!!!!! I love scripts!


Edited by itdaddy (2007-01-12 09:59 PM)
_________________________
Robert
A+, CCNA, MCP
Network Admin
Credit Union Wisconsin