0

I'm using PowerShell to scrape the web and I'm trying to bypass the download dialog of Internet Explorer.

enter image description here

Everywhere in the internet (example 1, example 2) I find this code:

$wshell = new-object -com wscript.shell
$wshell.appactivate("Save As")
$wshell.sendkeys("%s")
$wshell.sendkeys("{Enter}")

but when I try to execute it just set the Num Lock On:

enter image description here

What am I doing wrong?

Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113

1 Answers1

0

Not sure why but I fixed by using

Add-Type -AssemblyName System.Windows.Forms
[System.Windows.Forms.SendKeys]::SendWait("%s")

( Send Keys in Powershell alt+n {TAB} {ENTER} )

Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113