I remade my post because my first post was formatted wrong and it was stupid. This should be easier. (why does the website not allow deleting posts?!)
I'm trying to find out why this returns Restart when the input is anything except shutdown. it can be Google or Chrome or Google Chrome or even something random but still returns Restart. If the input is shutdown it runs shutdown normally.
#include <Constants.au3>
#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>
#include <File.au3>
Local $a, $b, $c, $d
Local $aFileList = _FileListToArray("C:\Users\333el\Dropbox\IFTTT", Default, Default, True)
aLoop()
Func aLoop()
Local $aFileList = _FileListToArray("C:\Users\333el\Dropbox\IFTTT", Default, Default, True)
While @error = 4
Sleep(3000)
$aFileList = _FileListToArray("C:\Users\333el\Dropbox\IFTTT", Default, Default, True)
WEnd
arun()
EndFunc
Func arun()
$aFileList = _FileListToArray("C:\Users\333el\Dropbox\IFTTT", Default, Default, True)
_PathSplit($aFileList[1], $a, $b, $c, $d)
MsgBox($MB_SYSTEMMODAL, "Test", "Found: " & $c)
If $c == "shutdown" Then
FileDelete($aFileList[1])
MsgBox($MB_SYSTEMMODAL, "Test", "Shutdown")
;Shutdown(1)
Exit
ElseIf $c == "reboot" or "restart" Then
FileDelete($aFileList[1])
MsgBox($MB_SYSTEMMODAL, "Test", "Restart")
;Shutdown(2)
Exit
ElseIf $c == "Google" or "Chrome" or "Google Chrome" then
FileDelete($aFileList[1])
ShellExecute("chrome.exe", "http://URL1 --new-window --start-fullscreen")
Else
FileDelete($aFileList[1])
aLoop()
EndIf
EndFunc