Advertisement
Guest User

Untitled

a guest
Oct 12th, 2018
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.69 KB | None | 0 0
  1.  
  2.  
  3. $watching = "path to watching dir + fileextention to watch\*.pdf*"
  4. $open = "path to exe to open"
  5. FileChangeDir ("path to watching dir")
  6.  
  7. $timetowatch = 3 * 1000
  8. $timestamp = TimerInit()
  9.  
  10. While 1
  11.     If TimerDiff($timestamp) >= $timetowatch Then
  12.         $check = FileFindFirstFile($watching)
  13.         If $check <> -1 Then
  14.             While 1
  15.                 $file = FileFindNextFile($check)
  16.                 If @error Then ExitLoop
  17.                 ConsoleWrite ($open)
  18.                 $path = ($open &" "& $file)
  19.                 ConsoleWrite ($path)
  20.                 run ($path)
  21.                 sleep (3000)
  22.                 FileDelete($file)
  23.             WEnd
  24.         EndIf
  25.         $timestamp = TimerInit()
  26.     EndIf
  27.     Sleep (20)
  28. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement