What I have tried and didn't work:
cmd.exe
I have also used the sleep
command after every type, just to make sure that it is not skipping because of fast execution.
;Run application
Run("cmd.exe")
;Wait for CMD to be opened
WinWaitActive("Administrator: C:\Windows\system32\cmd.exe", "", 15)
;Write some commands on cmd
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "cd\")
Sleep(10000)
Send("{Enter}")
Sleep(10000)
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "cd C:\Program Files (x86)\Jenkins")
Sleep(10000)
Send("{Enter}")
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "Edit1", "jenkins.exe start")
Sleep(10000)
Send("{Enter}")
I got the answer:
ControlSend("Administrator: C:\Windows\system32\cmd.exe", "", "", "cd C:\Program Files (x86)\Jenkins")
I needed to remove "Edit" , as cmd is not an editable window.
Start your program directly:
RunWait(@ComSpec & " /c jenkins.exe start", "C:\Program Files (x86)\Jenkins")
Use &
Exp :
$CMD = 'cd %tmp% & md 1 & md 2 & cd %tmp%/1 & md 3 4 & md "5 6" &'
RunWait(@ComSpec & " /c " & $CMD )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With