The first line of the script should be Sub Main(). The last line should be End Sub. Now, set the job to run detached, this way it will not be able to bring 24x7 down when it runs in the normal mode. Let the job run in that mode and then after refreshing log view (View/Refresh menu) check the job log for errors. If you find any please post the complete error message. : I am trying to run the script below which works as a stnd alone vbs file. : When I try to run it in 24x7 it wants the Main procedure. If I add the Sub : Main() and End Sub to the script it shutsdown 24x7 when I run it. What : else do I need to modify for this to execute in 24x7? : Thanks! : Dim ReadCount : Dim rcCHKfile : Dim SelSource : Dim filesys : Const ForReading = 1, ForWriting = 2, ForAppending = 8 : Set filesys = CreateObject("Scripting.FileSystemObject") : set rcCHKfile = filesys.OpenTextFile("c:\Temp\CL32_ORI.txt", 1, : FALSE) : ReadCount = 2 : While ReadCount < 7 : rcCHKFile.ReadLine : If ReadCount = 6 Then : SelSource = (Mid(rcCHKFile.readline, 74, 3)) : rcCHKfile.Close : dim filesys2 : set filesys2=CreateObject("Scripting.FileSystemObject") : If filesys2.FileExists("c:\Temp\CL32_ORI.txt") Then : filesys2.MoveFile "c:\Temp\CL32_ORI.txt", : "c:\Temp\CL32_ORI." & SelSource : End If : End If : ReadCount = ReadCount + 1 : Wend : ReadCount = 0
|