Advertisement
Guest User

Untitled

a guest
Jul 28th, 2019
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.70 KB | None | 0 0
  1. #include <File.au3>
  2.  
  3. Apri_File_Random(Richiedi_Percorso_Cartella())
  4.  
  5. Func Richiedi_Percorso_Cartella()
  6.  
  7.     Local $Percorso_Cartella = InputBox("Percorso cartella", "Vuoto per scegliere dalla cartella attuale")
  8.     Return $Percorso_Cartella
  9.  
  10. EndFunc
  11.  
  12. Func Apri_File_Random($Percorso_Cartella)
  13.  
  14.     Local $Array_Lista_Files_Cartella
  15.     Local $Array_Lista_Files_Cartella_Size
  16.  
  17.     If $Percorso_Cartella == "" Then
  18.         $Percorso_Cartella = @ScriptDir
  19.     EndIf
  20.  
  21.     $Array_Lista_Files_Cartella = _FileListToArray($Percorso_Cartella, "*", 1)
  22.     $Array_Lista_Files_Cartella_Size = UBound($Array_Lista_Files_Cartella)
  23.  
  24.     ShellExecute($Array_Lista_Files_Cartella[Random(1, $Array_Lista_Files_Cartella_Size - 1, 1)])
  25.  
  26. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement