Handling a popup box using powershell

前端 未结 3 1801
再見小時候
再見小時候 2021-01-28 21:43

Can anyone please tell me how to click on \"ok\" or \"cancel\" on a popup window using powershell? I am trying to automate a website using powershell, but I am new to powershell

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-28 22:20

    Try something like this:

    $wshell = New-Object -ComObject wscript.shell; 
    $wshell.AppActivate('Vector RP1210 API Setup') 
    Sleep 1 
    $wshell.SendKeys('%C')
    $wshell.AppActivate('Vector RP1210 API') 
    Sleep 1 
    $wshell.SendKeys('{ENTER}')
    

提交回复
热议问题