Hello all - I am trying to get a VBS to detect an existence of a file - there is a possibility that the application could be ran multiple times so I am writing the file with APPLICATION_MMDDYYYY.log format that way if it ran today it detects and thinks it is a success
as for the detect of the file I have this, but only detects APLICATION.log - how do I add creating the MMDDYYYY inside of it and then detect that file?
‘Declare needed variables
Dim FSO, File, WaitTime, TotalWaitTime
‘ Initialize constants
Const InitialTime = 30000
Const Delay = 60000
Const Timeout = 600000
‘ Set inital values
Set FSO = CreateObject (“scripting.FileSystemObject”)
File = “C:\temp\APPLICATION.LOG”
WaitTime = InitialTime
TotalWaitTime = 0
‘ Loop until file is found or timeout exceeded, sleeping for WaitTime between each iteration
Do While TotalWaitTime < Timeout
TotalWaitTime = TotalWaitTime + WaitTime
WScript.sleep WaitTime
If fso.fileExists (File) Then
WScript.sleep Delay
WScript.StdOut.Write “The file was detected”
WScript.Quit(0)
End If
Loop
WScript.Quit(0)