#117974 - 2004-04-15 09:22 AM
Problem getting Scheduled Task to execute properly
|
stooz
Fresh Scripter
Registered: 2003-05-19
Posts: 11
|
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
|
|
Top
|
|
|
|
#117976 - 2004-04-15 12:00 PM
Re: Problem getting Scheduled Task to execute properly
|
stooz
Fresh Scripter
Registered: 2003-05-19
Posts: 11
|
I logged on with the user, if I execute the task then, it works fine....
This one really stumped me!
|
|
Top
|
|
|
|
#117979 - 2004-04-15 03:34 PM
Re: Problem getting Scheduled Task to execute properly
|
stooz
Fresh Scripter
Registered: 2003-05-19
Posts: 11
|
Sorry for the mistake!! Everything seems fine now. Thanks for all the help everyone!
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1003 anonymous users online.
|
|
|