Code:
call "tcLib.kxf"

tcInit(1)

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


$ThisMyArray = "ftran1", "ftran2", "ftran3"

For Each $Element In $ThisMyArray

	  tcGetEvent($Element, $Task)  ; load the bad task data
          @SERROR ?
	  
	  tcDefineTask("SUS=0")       ; set it to Suspend (disable = 1, enable = 0)
          @SERROR ?
	  
	  tcSetEvent($Element, $Task)  ; update the task on the target
          @SERROR ?

	  ;IF @ERROR <> 0
	  ;     $RC = REDIRECTOUTPUT (failure.txt, 0)
	  ;     ? $Element
	  ; Else if @ERROR = 0
	  ;      $RC = REDIRECTOUTPUT (success.txt, 0)
	  ;     ? $Element
	  ; Endif Endif
sleep 30

 Next




Glenn, I did what you said and the message out was (The operation completed successfully). This means that @ERROR = 0 correct and if it @ERROR = 1 then it should say it failed. All three functions SUCCESSFUL?
So why doesn't this work well. It doesn't work. I tried it. With ftran2. I shut the workstation off to see if it would usher failed workstation names to the failure.txt? sometime its worked other times they all went into the failure.txt bucket even though all of them succeeded?

So why is it not doing what normally works in this scheme. It does work on my other script where it maps the drive and upon success or failure adds workstation names accordingly? thanks.

Yes, guys I know the error trap is commented out for a reason this time.
Thanks if you guys try to correct me. Thanks



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