Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $watching = "path to watching dir + fileextention to watch\*.pdf*"
- $open = "path to exe to open"
- FileChangeDir ("path to watching dir")
- $timetowatch = 3 * 1000
- $timestamp = TimerInit()
- While 1
- If TimerDiff($timestamp) >= $timetowatch Then
- $check = FileFindFirstFile($watching)
- If $check <> -1 Then
- While 1
- $file = FileFindNextFile($check)
- If @error Then ExitLoop
- ConsoleWrite ($open)
- $path = ($open &" "& $file)
- ConsoleWrite ($path)
- run ($path)
- sleep (3000)
- FileDelete($file)
- WEnd
- EndIf
- $timestamp = TimerInit()
- EndIf
- Sleep (20)
- WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement