Below is the VBS script I wrote. The intention was to first open cmd, then use SendKeys to type edit and {ENTER}, so as to enter the edit interface, and then use SendKeys to input other data into edit.
Specifically as follows:
Although the cmd edit window is already in the activated state, the final step of typing "i" never appears in the edit interface, while I can type characters with the keyboard by hand. Please ask the expert, what is the reason?
Thank you!
Specifically as follows:
dim wshshell
set wshshell=WScript.CreateObject("WScript.Shell")
wshshell.Run "C:\WINDOWS\system32\cmd.exe"
WScript.Sleep 200
wshshell.SendKeys "edit"
WScript.Sleep 200
wshshell.SendKeys "{ENTER}"
WScript.Sleep 1000
wshshell.AppActivate "C:\WINDOWS\system32\cmd.exe - edit"
WScript.Sleep 2000
Rem The above all work normally and execute effectively, but the next step is not possible:
wshshell.SendKeys "i"
Although the cmd edit window is already in the activated state, the final step of typing "i" never appears in the edit interface, while I can type characters with the keyboard by hand. Please ask the expert, what is the reason?
Thank you!

