Windows – CMD Batch file virtually press the enter key

batchbatch filecommand linewindowswindows 7

I am working in a manufacturing company. We manufacture PCB for HDD. Each PCB need to be loaded with firmware in manufacturing process. I would open the application the i would browse for the suitable ini file and then start uploading the FW to PCB.My problem is when I open the application initially it would show some warning message box with window name "Warning" for CRC error. Then I would close this window by clicking OK button or the "X" button int the corner an then load correct ini file and start uploading the process. I would like to create a batch file which will open the FW application close this warning window. I find that there are only three possible ways.

  1. The batch file must virtually press "Enter" key to click OK button to close the warning window.
  2. The batch file must virtually press the corner "X" button to close the warning window.
  3. The batch file must look for the window name "Warning" and close it.

I have surfed through internet for a solution but I end up helpless. If there is any way it would be greatly helpful.

Best Answer

Autohotkey is a great free app that can do what you require - http://www.autohotkey.com/board/topic/20202-automatically-clicking-ok-in-a-dialog-box/

Related Question