NovKit Posted January 16, 2022 Share Posted January 16, 2022 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. expandcollapse popup#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 KeiosStarqua 1 Link to comment Share on other sites More sharing options...
Solution Werty Posted January 16, 2022 Solution Share Posted January 16, 2022 ElseIf $c == "reboot" or "restart" Then That doesnt look right, should be something like... ElseIf $c = "reboot" or $c = "restart" Then So all in all, untested obviously... 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 $c = "restart" Then FileDelete($aFileList[1]) MsgBox($MB_SYSTEMMODAL, "Test", "Restart") ;Shutdown(2) Exit ElseIf $c = "Google" or $c = "Chrome" or $c = "Google Chrome" then FileDelete($aFileList[1]) ShellExecute("chrome.exe", "http://URL1 --new-window --start-fullscreen") Else FileDelete($aFileList[1]) aLoop() EndIf EndFunc == is for case sensitivity. use single = Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
NovKit Posted January 16, 2022 Author Share Posted January 16, 2022 Thank you Werty ❤️ Link to comment Share on other sites More sharing options...
Werty Posted January 16, 2022 Share Posted January 16, 2022 No problem, btw, you can edit your posts by clicking the 3 small dots in the upper right corner of your post, there's an edit option. KeiosStarqua 1 Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
Developers Jos Posted January 16, 2022 Developers Share Posted January 16, 2022 11 hours ago, Werty said: there's an edit option. That's not there yet for the OP as long as the group is "New Members" KeiosStarqua and Werty 1 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now