# Disable .URL files before the baddies use them

**URL:** <https://ifin.network/t/disable-url-files-before-the-baddies-use-them/393>\
**Category:** Threat Intel\
**Tags:** windows, microsoft\
**Created:** [May 7, 2026, 3:36pm UTC](https://ifin.network/t/disable-url-files-before-the-baddies-use-them/393 "2026-05-07T15:36:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mttaggart](https://ifin.network/user_avatar/ifin.network/mttaggart/32/7_2.png) [@mttaggart](https://ifin.network/u/mttaggart)\
**Post date:** [May 7, 2026, 3:36pm UTC](https://ifin.network/t/disable-url-files-before-the-baddies-use-them/393/1 "2026-05-07T15:36:15Z")

</div>

Direct action you can take to confound the adversary? Yes _please_.

Thanks to the always-amazing Will Dormann, we have some valuable information on the continued exploitation of `.URL` file extensions by threat actors. And it turns out, per Will, that Microsoft doesn’t view this as a problem—indeed, it is “expected behavior.”

> **[Will Dormann (@wdormann@infosec.exchange)](https://infosec.exchange/@wdormann/116533862391306228)**
>
> Attached: 1 image
> 
> Let's talk about Windows \`.URL\` (InternetShortcut) files.
> 
> Last year there was discussion about a vulnerability in how Windows handles \`.URL\` files. Specifically, when a \`.URL\` file specifies a \`WorkingDirectory\` directive, an...

So how do you fix it?

Registry haxx, of course.

For the current user:

```cmd
reg add HKCU\Software\Classes\.url /ve /d DisabledURLFile /f
reg add HKCU\Software\Classes\DisabledURLFile /ve /d "Disabled Internet Shortcut" /f
reg add HKCU\Software\Classes\DisabledURLFile\shell\open\command /ve /d "notepad.exe \"%1\"" /f
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url /f

```

In an elevated shell for the system:

```cmd
reg delete HKCU\Software\Classes\.url /f
reg delete HKCU\Software\Classes\DisabledURLFile /f
reg delete HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.url /f
reg delete HKLM\Software\Classes\.url.original /f
reg copy HKLM\Software\Classes\.url HKLM\Software\Classes\.url.original /s /f
reg delete HKLM\Software\Classes\.url /f
reg add HKLM\Software\Classes\.url /ve /d DisabledURLFile /f
reg add HKLM\Software\Classes\DisabledURLFile /ve /d "Disabled Internet Shortcut" /f
reg add HKLM\Software\Classes\DisabledURLFile\shell\open\command /ve /d "notepad.exe \"%1\"" /f

```

And while you’re at it, do the same thing for `.js` files to prevent JScript malware.

```cmd
reg add HKCR\JSFile\shell\Open\Command /ve /d "notepad.exe \"%1\"" /f 
reg add HKLM\SOFTWARE\Classes\JSFile\shell\Open\Command /ve /d "notepad.exe \"%1\"" /f 
reg add HKCU\SOFTWARE\Classes\JSFile\shell\Open\Command /ve /d "notepad.exe \"%1\"" /f 

```

---

<div class="post-metadata">

**Author:** ![mttaggart](https://ifin.network/user_avatar/ifin.network/mttaggart/32/7_2.png) [@mttaggart](https://ifin.network/u/mttaggart)\
**Post date:** [May 7, 2026, 6:03pm UTC](https://ifin.network/t/disable-url-files-before-the-baddies-use-them/393/2 "2026-05-07T18:03:52Z")

</div>

Made modifications based on Will’s suggestions here:

> **[Will Dormann (@wdormann@infosec.exchange)](https://infosec.exchange/@wdormann/116534337551455290)**
>
> Attached: 1 image
> 
> @mttaggart 
> And I'll admit that "disassociate .URL files from opening in Windows" is a touch more hand-wavy than it should be, I suppose.
> 
> When double-clicking a file in Windows, there's a little dance of system-wide file...
