So, I have the following code
FileName = "Path\To\FileName"
Set FSO = CreateObject("Scripting.FileSystemObject")
Do
If FSO.FileExists(FileName) Then
FSO.DeleteFile FileName
End If
WScript.Sleep 1000
Loop
It looks for a specific file over and over again and once it is found it is deleted.
I want to modify it, I want this script to look for file over and over again and once it is found I just want to open that text file and stop the execution of the script.
Looking forward to your help :)
Use the WScript.Shell object to launch a file or application in VBScript.
For an HTA application, you need to use setTimeOut for the 'loop'
Thanks to Hackoo for getting me on the right track :)