SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Running VBScript

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Running VBScript
Author Message
Jason Hoskins



Joined: 12 Mar 2004
Posts: 68

Post Running VBScript Reply with quote

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

Fri Nov 12, 2004 9:43 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7969

Post Re: Running VBScript Reply with quote

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

Fri Nov 12, 2004 11:20 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.