Ok, so I have a .bat file that opens application1.exe, enabledriver.bat, and ahkscript.exe
Would it be possible to program the ahkscript to run another .bat file once it detects application1.exe closes?
Basically the first .bat that is ran enables a driver via devcon, but once application1 closes, I need it to run disabledriver.bat and then proceed to close ahkscript.exe as well.
I have this below that I found for closing the ahkscript when application1 closes, but no idea how to get it o run .bat before quitting ahkscript.exe
Any help would be greatly appreciated! Thank you!
Code: Select all
#NoEnv
#SingleInstance, Force
#Persistent
SetTitleMatchMode, 2
DetectHiddenWindows, On
SetTimer, ProcessCheckTimer, 3000
Return
ProcessCheckTimer:
Process, Exist, application1.exe
pid1 := ErrorLevel
If (!pid1)
{ Process, Exist, ahkscript.exe
pid2 := ErrorLevel
If (pid2)
Process, Close, %pid2%
ExitApp
}
Return