Sendkeys not working on the system Print window
after bring up the windows system print window on webpage by using powershell script , manually press enter key, print xps 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 all work after using $ie.execwb(6, 2) bring window up.
any idea why? thanks
i have no idea, then. have few desktop shortcuts vbscripts use manage making changes detailed property dialogs, activate them shortcut key, , find works well.
i tend not use "{enter}", see no reason cause problem. try sending space character instead, has same effect clicking on button has focus.
here's thought: possible default button highlighted if has focus when control has focus. 1 example of run dialog. of course, have said hitting actual enter key has desired effect. wonder if there in sendkeys causes "{enter}" behave in small way differently actual enter key.
al dunbar -- remember 'mark or propose answer' or 'vote helpful' appropriate.
Windows Server > Windows PowerShell
Comments
Post a Comment