Skip to content

Instantly share code, notes, and snippets.

@jymcheong
Created October 9, 2018 05:52
Show Gist options
  • Save jymcheong/29290a064c3921e78020b8b55f819fd4 to your computer and use it in GitHub Desktop.
Save jymcheong/29290a064c3921e78020b8b55f819fd4 to your computer and use it in GitHub Desktop.
Auto Run All EXEs
#include <File.au3>
#Include <WinAPI.au3>
#Include <WindowsConstants.au3>
Func Win_R($fullpath)
$splitArray = StringSplit($fullpath,"\")
$arraySize = UBound($splitArray)
Send("#r")
WinWait("Run", "", 10)
Send($fullpath & "{ENTER}")
Sleep(1000)
ProcessClose($splitArray[$arraySize - 1])
Sleep(2000)
Send("#d")
Sleep(100)
EndFunc
$file = "EXEs.txt"
FileOpen($file, 0)
For $i = 1 to _FileCountLines($file)
$line = FileReadLine($file, $i)
Win_R($line)
Next
ConsoleWrite("all done")
FileClose($file)
@jymcheong
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment