Skip to content

Instantly share code, notes, and snippets.

@mistificator
Last active October 25, 2023 14:20
Show Gist options
  • Save mistificator/270a1a15f6ef94320e09741529af4bf2 to your computer and use it in GitHub Desktop.
Save mistificator/270a1a15f6ef94320e09741529af4bf2 to your computer and use it in GitHub Desktop.
.reg file that registers URL protocol "smb://" for SMB shared folders
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\smb]
"URL Protocol"=""
[HKEY_CLASSES_ROOT\smb\shell]
[HKEY_CLASSES_ROOT\smb\shell\open]
[HKEY_CLASSES_ROOT\smb\shell\open\command]
@="powershell -WindowStyle Hidden -Command \"& { Invoke-Expression $(-join('cmd /c', [URI]::UnescapeDataString('start %1').Replace('smb://', '//').Replace('/', '\\'))) }\""
@mistificator
Copy link
Author

mistificator commented Oct 24, 2023

Example URLs:

smb://server.local/Public
smb://NAS/Devices%20Backup/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment