不断查找文件,当文件存在时,运行命令

不断查找文件,当文件存在时,运行命令
FileName = "C:\Users\amrapab\Desktop\Test\remedy\Auto\Open dump 23 Mar.csv"
Set FSO = CreateObject("Scripting.FileSystemObject")
Do
   If FSO.FileExists(FileName) Then 

       CreateObject("WScript.Shell").Run "C:\Users\amrapab\Desktop\Test\remedy\Auto\test.vbs"
FSO.DeleteFile FileName
   End If
   WScript.Sleep 1000
Loop

相关内容