How to access IE11 file save dialog?

Feb 27, 2015 at 9:20 PM
The file save pop up has no title on IE11/Windows 8.1. How can I select the Save or Cancel button? I tried sending %S but sometimes it grabs the IE Safety menu. I need something like:

Select-Window iexplore | Select-Control -Class "Frame Notification Bar" | Set-WindowActive | Send-Keys "%S"

but more precisely targeted to the dialog box.

Feb 28, 2015 at 5:36 AM
I'm a lot confused. Are you using the universal app version of explorer? Otherwise the file save should be a regular dialog box ...

Select-Window iExplore | Select-ChildWindow | Set-WindowActive | Send-Keys "%S"
Mar 9, 2015 at 9:42 PM
Edited Mar 9, 2015 at 9:42 PM

It's not a standard file dialog in IE11 in Windows 8.1; I have also tried your example code and it does not work. It's some kind of hybrid window with no title. The Alt-S will open the Safety menu if it does anything at all.

Mar 9, 2015 at 10:42 PM
Oh ... that thing.

I wonder what makes that come up some times but not others? That is a DirectUIHWND, it's basically invisible, as far as I can tell.
You can use Send-Keys though, just have to target that hwnd:
Select-UIElement -ProcessName iexplore |               # Get IE
Select-UIElement -Class "Frame Notification Bar" |     # Find the notification bar
Select-UIElement -class "DirectUIHwnd" |               # And the invisible window
Send-Keys "%S" -WindowHandle { $_.NativeWindowHandle } # Send-Keys doesn't have an alias "NativeWindowHandle" on  WindowHandle
You could also use right-click "save as" in the previous step of your automation to force the other dialog.
Mar 9, 2015 at 11:02 PM
Thanks, I will try this. Unfortunately can't even do a right click as the download link is a JavaScript pop up menu
Mar 10, 2015 at 7:21 PM
Please bear with me as I am not a PowerShell guru. It looks like Select-UIElement is part of a newer version from poshcode. I can't for the life of me get it to work and there seems to be no link from the download page on this site or install instructions for the three necessary modules. Can you help?
Mar 10, 2015 at 9:27 PM
Edited Mar 10, 2015 at 9:28 PM
Oh my gosh. That explains why I had to do the crappy -WindowHandle mapping, I was mixing and matching cmdlets from two different modules. LOL. I swear when I was writing that example yesterday I wanted to call the me that wrote Send-Keys an idiot for missing the "NativeWindowHandle" alias ;-)

Just use the old commands:
Select-Window iexplore |
Select-Control -Class "Frame Notification Bar" |
Select-Control -class DirectUIHwnd | 
Send-Keys "%S"   # magically picks up the window handle, as it should! duh!
Hopefully that works for you, sorry about that.
Mar 10, 2015 at 11:09 PM
Thanks! Finally got this to work. The Alt-S will still randomly select the Safety menu if it is there so I worked around it by temporarily turning off the toolbar with:

$ie.ToolBar = $false

There's quite a few unanswered questions around on this. Hopefully this thread will now show up in searches.
Aug 23, 2016 at 4:24 PM
How would you close this DirectUIHWND window with Send-Keys?
Aug 24, 2016 at 5:12 AM
maskull wrote:
How would you close this DirectUIHWND window with Send-Keys?
Try opening a new question with a little bit more information?