#include #Include #include $path = "D:\CTS ppt" $FileArray = _FileListToArrayRec ( $path, '*.jpeg;*.pptx;*.xls;*.xlsx',1) For $i = 1 To $FileArray[0 If $FileArray[i]==".jpg" ShellExecute($path & "\" & $FileArray[$i]) Sleep(2000) ;HotKeySet("#{F4}", "_exit") Send("!+{F4}",0) Next ;_ArrayDisplay($FileArray, "Sorted tree") ;WinWaitActive("[CLASS:screenClass]" ) ;full screen mode of ppt ;FileClose($FileArray[$i]) Func _forceshutdown() Shutdown(5) ;Force a shutdown MsgBox(0, "Automatic program", "!! Shutting down !!",18) EndFunc