0

I want to create a workaround for the URL protocol file: in Chrome, as it's security doesn't allow you to open certain files or locations. This would be for a small app of mine that I designed.

I searched around, and while I've found a lot of potentially good answers (such as this answer), I don't fully understand what each line should do, and whether it would actually work in my application.

The end-result that I want for this is to have a protocol like ih-link: that would allow me to open up links in Windows Explorer or elsewhere, similar to how you can do so in say, Outlook or Microsoft Word (if you create local or network shortcuts to a folder or file, it'll open it up without issue). Attempting this in Google Chrome gives varied results, either a browser-generated directory, or an error ususally.

I'd like to know, assuming the answer I linked to would work for me...

  • Is "URL Protocol"="" where I'd define the name of the protocol, so I'd use "URL Protocol"="ih-link", or something like that? I remember reading something about leaving that blank, so would I replace IntranetFileLauncher with whatever protocol name I want (in this case, it'd be ih-link?)
  • The next part that references explorer.exe seems to just reference the icon.
  • After that, what do the following two lines do? [HKEY_CLASSES_ROOT\IntranetFileLauncher\shell] [HKEY_CLASSES_ROOT\IntranetFileLauncher\shell\open]
  • The last lines of that script appear to just have it strip the protocol from the URL and pass the file path to explorer.. am I correct on this? I take it I would need to format the path as I would do for windows (using \ instead of /)?

I'm afraid to experiment without knowing more, mainly because I know that many things with the registry can be very dicey, so any clarification on this would be helpful.

1 Answer 1

1

Reading the actual documentation is better than trying to guess what some random code sample does.

  • URL Protocol is just a marker, it does not need a value. The default value (@) is where the name of your protocol is stored.
  • Yes, that entry (incorrectly) specifies the icon.
  • Those two lines are pointless. They create two empty keys but only the ...\shell\open\command line is required to properly build that registry path.
  • Yes, you might have to change / to \, add: call set url=%url:/=\% to the command.

Using cmd.exe to parse untrusted input is not ideal, it would be better to write a custom application.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.