Windows – Opening smb:// links on windows

networkingsambawindows

Is there any way to make Windows (10 preferably) explorer to open smb protocol URI? Like smb://1.2.3.4/file.txt

I'm in a diverse environment of operating systems (mostly windows, mac and linux) and also web services we're using (slack, youtrack) but all our files are sitting on a server with samba share and it's hard to have clickable links that all can access.

We have two options for unification:

  1. The Windows way – file://X:/
  2. The Unix way? – smb://1.2.3.4/

I've found it's easier to use the smb links with web tools, slack recognizes them, mac and linux open them fine, it's just that windows are refusing to recognize the protocol, although the address itself works.

Best Answer

Thanks DavidPostill for pointing me into the right direction. Here is what I did:

Registry file (smb.reg):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\smb]
"URL Protocol"=""
@="URL:SMB Protocol"

[HKEY_CLASSES_ROOT\smb\DefaultIcon]
@="explorer.exe,1"

[HKEY_CLASSES_ROOT\smb\shell]
[HKEY_CLASSES_ROOT\smb\shell\open]
[HKEY_CLASSES_ROOT\smb\shell\open\command]
@="\"C:\\OpenLink\\openLink.bat\" \"%1\""

Batch file (openLink.bat):

@echo off
set str=%1
set str=%str:smb:=%
set str=%str:/=\%
explorer.exe %str%

And it works great. :)