Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbrownnycnyc/5535839 to your computer and use it in GitHub Desktop.
Save mbrownnycnyc/5535839 to your computer and use it in GitHub Desktop.
Quick little batch script to parse the file URI when executed in explorer, because skype likes to change UNC paths to file URIs (and it has it's own handling). Relies on the win32 port of the gnucoreutils to be in the %path%.
echo "sed s/file:// %1 > %temp%\_holder" > c:\windows\fileurihandler.bat
echo "set /p holder= < %temp%\_holder" >> c:\windows\fileurihandler.bat
echo "echo %holder% | sed s@\/@\\@g > %temp%\_final" >> c:\windows\fileurihandler.bat
echo "set /p holder= < %temp%\_final" >> c:\windows\fileurihandler.bat
echo "del /q /f %temp%\_holder" >> c:\windows\fileurihandler.bat
echo "del /q /f %temp%\_final" >> c:\windows\fileurihandler.bat
echo "explorer %holder%" >> c:\windows\fileurihandler.bat
reg add HKCR\file\shell\open\command /ve /d "c:\windows\fileurihandler.bat %1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment