![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
|
I have an ActiveX Script task in a DTS package which executes fine within DTS. However, if I run it as a sheduled job, it fails with a 'path not found error'. I've cut the code down to the approriate problem and posted it here, it just makes a simple text file with a name derived from the current date and time and puts 'Hello World' in the file although in reality I go on to make an xml file. (make sure your path exists before you execute it). Why does the scheduled job not execute this simple task. I have loads of other jobs that run packages to a schedule and the account is a domain account with windows administrative rights. '****************************** ' Visual Basic ActiveX Script '********************** Const strPath="d:\xml" Private Function GetDateTime() Dim strNow, stryear, strMonth, strDay, strTime strNow = Now stryear = Mid(strnow, 7, 4) strMonth = Mid(strnow, 4, 2) strDay = Left(strnow, 2) strTime = Replace(Mid(strnow, 12, 8), ":", "") GetDateTime = stryear + strMonth + strDay + strTime End Function Function Main() Dim fso,f,MyFile 'file objects Set fso = CreateObject("Scripting.FileSystemObject") dim strRightNow strRightNow=GetDateTime() Set MyFile= fso.CreateTextFile(strPath &"\" & "UPD-" & strRightNow & ".txt", True) 'This line fails from a scheduled job MyFile.WriteLine("Hello World") MyFile.Close Main = DTSTaskExecResult_Success End Function 'Error Source= Microsoft VBScript runtime error Error Description: Path not found Error on Line 25 |
![]() |
| Thread Tools | |
| Display Modes | |
| |