I need help..... I have a script which I have included that will not run with the WINAT.EXE which was provided with the NT 4 Resource kit. I add the scheduled task in the following manner; C:\Scripts\kix32.exe c:\scripts\drvspc.kix.

When it runs nothing is sent but the error message that is within the script. If I run from the command line, it works fine. I have not yet been able to get a job scheduled on a workstation yet.... Anyone have ideas?

** [CODE} **
break on cls
;=========================================================================================
; DRVCHK.KIX
;=========================================================================================
;=========================================================================================
; You must use double @. Send to multi admins by separating email address with a ,
;=========================================================================================
$adminEmail = 'administrator@@whatever.com'

;=========================================================================================
; Check to make Sure the BLAT Software program is installed within the Registery
;=========================================================================================
$blatRegKey = "HKEY_LOCAL_MACHINE\SOFTWARE\Public Domain\Blat"

;=========================================================================================
; Use the Carbon Copy Database
;=========================================================================================
$ccbase = "c:\scripts\ccbase.ini"

;=========================================================================================
; Create a Return and Line Feed
;=========================================================================================
$cr = chr(13)+chr(10)
$space = ' '
$FILL="| |"
;=========================================================================================
; Set the Tempary Directory location
;=========================================================================================
$tempfile = "%temp%\temp.dat"

;=========================================================================================
; Set the Counter to value of One
;=========================================================================================
$counter = 1

Dim $Drv[23]
$Drv[1]="\\dom-A\C$"
$Drv[2]="\\dom-A\E$"
$Drv[3]="\\dom-A\F$"
$Drv[4]="\\bdc-A\C$"
$Drv[5]="\\bdc-A\E$"
$Drv[6]="\\bdc-A\F$"
$Drv[7]="\\bdc-A\G$"
$Drv[8]="\\bdc-A\H$"
$Drv[9]="\\wts\C$"
$Drv[10]="\\wts\D$"
$Drv[11]="\\gateway\C$"
$Drv[12]="\\nnt\C$"
$Drv[13]="\\nnt\D$"
$Drv[14]="\\nnt\E$"
$Drv[15]="\\dom-B\C$"
$Drv[16]="\\dom-B\E$"
$Drv[17]="\\dom-B\F$"
$Drv[18]="\\dom_C\C$"
$Drv[19]="\\dom_C\E$"
$Drv[20]="\\dom_C\F$"
$Drv[21]="\\dom-D\c$"
$Drv[22]="\\dom-D\d$"

;=========================================================================================
; If the Blat Email Program does not exist on the Current system and no reg key exists
; the system displays an error message and exit's.
;=========================================================================================
if existkey($blatregkey) <> 0
? "This script requires the commandline mailer BLAT."
? "You can DL it from http://kix.isorg.net/kix_tools/Blat.zip"
? "To install place in the path, and type"
? "BLAT -install <mailserver> <administrator email address>"
exit
endif
;
;=========================================================================================
; Start the Log file process if BLAT exists, and the database is found.
;=========================================================================================
;gosub STARTLog

gosub stdro
$TmpMsg = '+-----------------------------------------------------------------------------+'+$cr+
'|****************************** [ ATTENTION! ] ******************************|'+$cr+
'+-----------------------------------------------------------------------------+'+$cr+
"|Drive Check for Date: "+SUBSTR($FILL,25+LEN($DateAMER),55-LEN($DateAMER))+$cr+
'------------------------------------------------------------------------------'+$cr
;
;=========================================================================================
; Loop until all the Drives have been checked
;=========================================================================================
While $counter <> "" and $counter < 23
$DriveVar = $Drv[$counter]
$Result = GetDiskSpace($DriveVar)
$TmpVar = ' Drive $DriveVar has'
$TmpLen = Len($TmpVar)
If $TmpLen < 28
Do
$TmpVar = '$TmpVar$space'
$TmpLen = $TmpLen+1
Until $TmpLen = 28
EndIf
If $Result = 0
$ResultMsg = '+------------------------------------------------------------------+'+$cr+
' There is a Possible ERROR, Please Check Log for $DriveVar'+$cr
Else
If $Result < 1024
$ResultMsg = '$TmpVar: FREE (KB) = $Result'+$cr
Else
$Result = $Result/1024
$ResultMsg = '$TmpVar: FREE (MB) = $Result'+$cr
EndIf
EndIf
$TmpMsg = '$TmpMsg$ResultMsg'
$log = $ResultMsg
$counter = $counter + 1
Loop
$TmpMsg = '$TmpMsg'+$cr+
'--------------------------------------------------------------------'+$cr
del $tempfile
$nul = open(2,$tempfile,5)
$nul = writeline(2,$TmpMsg)
$nul = close(2)
;=========================================================================================
; Send an email to the Address's with in the $ccbase data file
;=========================================================================================
shell '%comspec% /c blat $tempfile -cf $ccbase -Subject "Drive Size Usage Report for $DateAMER!" -noh2 -q'
Exit


:Stdro
;=========================================================================================
; {Standard Subroutine}
; {Version .01}
; {03/07/2001}
;-----------------------------------------------------------------------------------------
; {FILES Required: None}
;=========================================================================================
$DateENG=SUBSTR(@DATE,1,4)+SUBSTR(@DATE,6,2)+SUBSTR(@DATE,9,2)
$DateDEF=@DATE
$DateAMER=SUBSTR(@DATE,6,2)+"-"+SUBSTR(@DATE,9,2)+"-"+SUBSTR(@DATE,1,4)
$SystNM=@WKSTA
$SystIP=LTRIM(SUBSTR(@IPADDRESS0,1,3))+"."+LTRIM(SUBSTR(@IPADDRESS0,5,3))+"."+LTRIM(SUBSTR(@IPADDRESS0,9,3))+"."+LTRIM(SUBSTR(@IPADDRESS0,13,3))
$SystMC=SUBSTR(@ADDRESS,1,2)+":"+SUBSTR(@ADDRESS,3,2)+":"+SUBSTR(@ADDRESS,5,2)+":"+SUBSTR(@ADDRESS,7,2)+":"+SUBSTR(@ADDRESS,9,2)+":"+SUBSTR(@ADDRESS,11,2)
Return

Any help would be great. Thanks.