Code:
$Inputfile = "\\machine name\updates\updates\latest.txt"
$OutputFile = "c:\Update.Log"
$SDatVer = ""
$BatchFile = "c:\kix\UpdateSdat.bat"
;If Exist ($Inputfile)=1
; Del $Inputfile
; Sleep 1
; Shell "%comspec% /c dir \\virusserver\updates\updates\sdat*.* /O-D >$Inputfile /B"
;Else
; Shell "%comspec% /c dir \\virusserver\updates\updates\sdat*.* /O-D >$Inputfile /B"
;EndIf
Open(3,$Inputfile,2)
$SDatVer = ReadLine(3)
Close(3)
? $SDatVer
? @ERROR
If Exist($BatchFile) = 1
Del $BatchFile
EndIf
? $FileName
Open(9, $BatchFile, 5)
WriteLine(9, "call \\ts030374\updates\updates\sdat$SDatVer.exe")
Close(9)
;Shell $BatchFile
If @ERROR <> 0
Open(4, $outputfile, 5)
WriteLine(4, "@DATE @TIME - Update failed or no new update available @CRLF")
Else
Open(4, $OutputFile, 5)
WriteLine(4, "@DATE @TIME - Update to SDat Version sdat$SDatVer.exe Finished @CRLF")
EndIf
? @ERROR
This is the KIX script I compiled into an EXE using KIXScripts Editor.
When I run the EXE, it works fine. When I run the task with my userID, it works fine. I want to run the task with another user on all PC's, but it returns result code 0x80 and doesn't seem to do anything!! Neither the batch nor the log file is created. The user I run the task with, definately has access to all locations above.
I tried various different methods (as you can see from the commented code), but everything does the same.
Any help would be very much appreciated!!
Thanks a lot
StooZ