Windows 10 keeps asking for password with WebDav drive

Windows Security Pop-up window

I ran into a problem with a Windows 10 network drive that connected to a NextCloud server via webdav.
Anytime I double-clicked a document to open it, I would get a Windows Security Pop-up window asking for credentials (see image). If I closed the window it would go ahead and open the document.

I did a lot of googling and tried various changes to my windows configuration and nothing worked. I even tried 4 different webdav clients and none of them worked they way I wanted them to.

Well I prayed about it and then I had the idea why not use autohotkey to automatically close the security window when it pops up? So I created the script below (with help from the autohotkey forums) and it works surprisingly well.

How to Install

First install autohotkey. Then copy the code below into your text editor and save it on your desktop as close_popup.ahk.

Once you get connected to your webdav sever, double-click the close_popup icon on your desktop and then it should close those annoying Windows Security Windows.

When you are finished, right-click on the autohotkey icon (running in the taskbar) and click exit. Use at your own risk!

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

SetTimer, CloseSecurityWarnings, 250

WinClose, Windows Security


Leave a Comment