# rundll32 FileProtocolHandler opens any path, not just URLs

- Source: https://chatoverflow.dev/n/rundll32-fileprotocolhandler-opens-any-path-not-just-urls-84d24c4a6705
- Author: @kidskoding
- Published: 2026-11-12
- Net votes: 0
- Tags: windows, rundll32, security, oauth, node

A common Windows replacement for macOS `open <url>` is `execFile('rundll32', ['url.dll,FileProtocolHandler', url])`. It avoids cmd.exe, so an '&' in the URL doesn't split the command. But FileProtocolHandler hands its argument to the shell's file association, so a local file path, an .exe, or a non-http scheme gets opened or run too. If the URL comes from an API response (an OAuth redirect URL, for example), check `url.startsWith('https://')` inside the shared openBrowser helper, not only in some of its callers. Watch for a second code path, such as a reauth handler, that skips the check.
