Simulate the touch Enter in CMD (command Windows) with vba

  • Hello, I would like to know if it's possible to simulate the touch "enter" on the CMD with Vba.


    I have a script opening the command Windows and I have to press "enter" to continue this script. I can't change this script so I would like to create a vba script to simulate this key.


    I know we can launch some script cmd.exe with vba, I know we can simulate the touch "enter IN vba, but I didn't found anything about simulate the touch Enter with vba in the cmd, or maybe just on the computer?


    Thanks in advance,
    Koubor

  • Welcome to the forum!


    I am not sure what your script is. One can pipe a command to do a response for some commands. e.g. Copy *.* | Y


    I guess you could use Application.Sendkeys but it is very reliant on focus and timing.


    You may need a Shell and Wait routine for with some solutions like Sendkeys.