#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
msgbox, 0,, opening screen and audio (open usb debuging if it wont work)
run, cmd.exe
sleep, 1000
send, cd /d E:\Personal files\scrcpy
send, {enter}
sleep, 1000
send, adb devices
send, {enter}
sleep, 9000
msgbox, 4,, is adb on?
ifmsgbox yes
msgbox, 0,, Continue
Process, Close , cmd.exe
Else
ExitApp, [ ExitCode]
run, E:\Personal files\scrcpy\scrcpy.exe
sleep, 3000
ExitApp, [ ExitCode]
The code works fine without the "Process, Close , cmd.exe" but when it does have it gives me a "ELSE with no matching IF" error