'---------------------------------------------------------------------------------------------------------
'VB Script to run a DTS job only when a file exists. This puppy will sit waiting in the background
'quite happily. I hacked it together from some pre-existing code pretty quickly, so it will likely need some debugging.
'
'NOTE: The DTSRun line is just an example (which will obviously NOT WORK on your system.)
'Make sure you run the DTSRunUI utility to generate the correct command line for your job.
'---------------------------------------------------------------------------------------------------------
status = "no"
Set FSO = CreateObject("Scripting.FileSystemObject"
while status = "no"
ReportFileStatus("C:\temp\Whatever.mdb"

wend
MsgBox ("Done!"
Function ReportFileStatus(filespec)
Dim fso
Set FSO = CreateObject("Scripting.FileSystemObject"

If (fso.FileExists(filespec)) Then
InstallApplication("DTSRun /S "+chr(34)+"MyServer"+chr(34)+" /N "+chr(34)+"MyDTSJob"+chr(34)+" /G "+chr(34)+"{My Random Hash Code}"+chr(34)+" /L "+chr(34)+"C:\Temp\MyErrors.txt"+chr(34)+" /W "+chr(34)+"-1"+chr(34)+" /E "

status = "yes"
Else
status = "no"
WScript.Sleep 300000 ' Fortunately sleep takes up very little processing time
End If
End Function
Function InstallApplication(CommandLine) '...Run sequense of events listed above in CommanLine
Set WshShell = WScript.CreateObject("WScript.Shell"

Return = WshShell.Run(CommandLine, 1, true)
End function