rem This file needs sh.exe and sed.exe in your PATH, to be found at http://unxutils.sourceforge.net/ rem created by arjen@selwerd.nl, most of the stuff blatantly stolen from rem http://wallie.selwerd.nl/articles/2004/opening_smb_files_with_opera.html rem creates a file called smb.cmd in your WINDIR, and adding an smb:// protocolhandler rem in the register that calls it. @echo off echo @echo off > %WINDIR%\smb.cmd echo rem - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >> %WINDIR%\smb.cmd echo rem Opens smb:// directory links with explorer.exe>> %WINDIR%\smb.cmd echo rem for use with Opera which insists using their own file:// handling>> %WINDIR%\smb.cmd echo rem - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ->> %WINDIR%\smb.cmd echo rem requires: explorer.exe or rundll32.exe, sh.exe, sed.exe>> %WINDIR%\smb.cmd echo rem>> %WINDIR%\smb.cmd echo rem>> %WINDIR%\smb.cmd echo rem Simple option -- doesn't do files.>> %WINDIR%\smb.cmd echo rem sh -c "explorer.exe `echo %%1 | sed -e 's/^smb:/file:/'`">> %WINDIR%\smb.cmd echo rem>> %WINDIR%\smb.cmd echo rem>> %WINDIR%\smb.cmd echo rem Complex option -- may show escaping issues>> %WINDIR%\smb.cmd echo rem sh -c "rundll32.exe url.dll,FileProtocolHandler `echo \"%%*\" | sed -e s/^smb:// -e s:/:\\\\\\\\\\\\\\\\:g -e s/%%%%20/\\ /g`">> %WINDIR%\smb.cmd echo sh -c "rundll32.exe url.dll,FileProtocolHandler `echo \"%%*\" | sed -e s/^smb:// -e s:/:\\\\\\\\\\\\\\\\:g -e s/%%%%20/\\ /g`">> %WINDIR%\smb.cmd @echo REGEDIT4 > smb-register.reg @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\smb]>> smb-register.reg @echo @="URL:SMB URI">> smb-register.reg @echo "URL Protocol"="">> smb-register.reg @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\smb\DefaultIcon]>> smb-register.reg @for /f "tokens=1,2,3,4,5,6,7 delims=\\" %%i in ("%windir%") do @echo @="%%i\\%%j\\explorer.exe" >> smb-register.reg @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\smb\Shell]>> smb-register.reg @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\smb\Shell\Open]>> smb-register.reg @echo [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\smb\Shell\Open\Command]>> smb-register.reg @for /f "tokens=1,2,3,4,5,6,7 delims=\\" %%i in ("%windir%") do @echo @="%%i\\%%j\\smb.cmd %%L" >> smb-register.reg @smb-register.reg @del smb-register.reg