How to automate response to msgbox

后端 未结 6 582
遇见更好的自我
遇见更好的自我 2021-01-25 16:08

I am developing a C# application to automate the running of a legacy VBScript(vbs) file which calls several VB6 .exe files. The .exe files have message box pop-ups that I need t

6条回答
  •  清酒与你
    2021-01-25 16:50

    You can use the wsh SendKeys() function. However, because you need to ensure the message box is activated, you'll also need to call AppActivate() immediately before the SendKeys call.

    Even this is buggy, but I've written several scripts that do just this, and as long as you can predict when the message boxes will come up, you can send the [Enter] key to respond to it.

提交回复
热议问题