Page 1 of 1 1
Topic Options
#117974 - 2004-04-15 09:22 AM Problem getting Scheduled Task to execute properly
stooz Offline
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
#117975 - 2004-04-15 11:06 AM Re: Problem getting Scheduled Task to execute properly
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Sounds like a permsison problem to me. Could it maybe running that executable that it is falling over?

It might be worth checking out the FAQ to see the different ways of running scheduled tasks.
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#117976 - 2004-04-15 12:00 PM Re: Problem getting Scheduled Task to execute properly
stooz Offline
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
#117977 - 2004-04-15 12:28 PM Re: Problem getting Scheduled Task to execute properly
AzzerShaw Offline
Seasoned Scripter
****

Registered: 2003-02-20
Posts: 510
Loc: Cheltenham, England
Try adding the following :

Code:
 

Open(9, $BatchFile, 5)
WriteLine(9, "call \\ts030374\updates\updates\sdat$SDatVer.exe"+Chr(13)+Chr(10))
Close(9)




You will need to do this to all writeline
_________________________
If at first you don't succeed, try again. Then quit. There's no use being a damn fool about it. - W.C Fields

Top
#117978 - 2004-04-15 02:59 PM Re: Problem getting Scheduled Task to execute properly
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

This is the KIX script I compiled into an EXE using KIXScripts Editor



Not!

KiXscripts editor is a packager, NOT a compiler!
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117979 - 2004-04-15 03:34 PM Re: Problem getting Scheduled Task to execute properly
stooz Offline
Fresh Scripter

Registered: 2003-05-19
Posts: 11
Sorry for the mistake!! Everything seems fine now. Thanks for all the help everyone!
Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1003 anonymous users online.
Newest Members
StuTheCoder, M_Moore, BeeEm, min_seow, Audio
17884 Registered Users

Generated in 0.054 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org