Quantcast
Viewing all articles
Browse latest Browse all 21975

Sendkeys not working on the system Print window

After bring up the windows system Print window on a webpage by using Powershell script andmanually press Enter key, it will print to xps as default printer. However, it will not print after use SendKeys:

 $wshell = New-Object -com WScript.Shell
 $wshell.sendkeys("{ENTER}")

Or use

[void] [System.Reflection.Assembly]::LoadWithPartialName("'System.Windows.Forms")
[System.Windows.Forms.SendKeys]::SendWait("{Enter}")

 But they all work after using $ie.ExecWB(6, 2) to bring window up.

Any idea why? Thanks


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>