BUG: IE Can't Open Registered Helper App for URL with Spaces

Last reviewed: February 6, 1998
Article ID: Q176347
The information in this article applies to:
  • Internet Client SDK, versions 4.0, 4.01

SYMPTOMS

Attempting to invoke a helper application via an HTML link or Internet Explorer address bar with a URL of the form "telnet://some%20URL%20encoded%20string" results in the following error message from Internet Explorer 4.0:

   Internet Explorer cannot open the helper application for
      "telnet://some url encoded string/".
   The protocol specified in this address is not valid. Make sure the
      address is correct, and try again.

CAUSE

URLs with embedded spaces, whether they have been URL encoded to %20 or not, are automatically converted to a form that prevents Internet Explorer 4.0 from correctly locating the registered helper application.

RESOLUTION

Developers interested in registering their program as the helper application for a new URL protocol must create a Pluggable Protocol Handler if they need to support spaces in the URLs their application invokes.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

This bug is related to the documentation in the Internet Client SDK (InetSDK) under the following topic:

   Internet Client SDK: Internet Tools & Technologies; Monikers, URLs,
   Security Zones, and Pluggable Protocols; Overview; Appendix B:
   Registering an Application to a URL Protocol

As an example, this section illustrates the technique of registering an application for a protocol. The documentation shows how to register Notepad.exe as the handler for URLs of the form "note:c:\myfile.txt"

First of all, Notepad does not work correctly in this situation, as might be expected after reading this appendix in the InetSDK. When Internet Explorer 4.0 processes "note:c:\myfile.txt," it executes Notepad and passes the entire URL to it. Because Notepad does not understand URLs such as "note:c:\myfile.txt," it does not open the c:\myfile.txt file as expected.

The "telnet:" protocol is an example of an application (TELNET) registered in a similar manner by Internet Explorer 4.0 when it is installed. TELNET works as expected because the registered shell command under HKEY_CLASSES_ROOT\telnet\shell\open\command points to a routine in Url.dll that strips off the "telnet://" part and invokes Telnet.exe with the rest of the URL.

Second, as this article describes, if a URL contains spaces when it is invoked, "note:c:\program files\my file name with spaces.txt" for example, Internet Explorer fails to execute Notepad at all. An error message similar to the one listed under the SYMPTOMS section earlier appears.

Because spaces are invalid characters in correct URLs, the proper form of the above example would be "note:c:\program%20files\my%20file%name." Unfortunately, this example does not work correctly either, as Internet Explorer pre- converts the %20's back to spaces before passing the string on to the shell to execute.

For custom protocols such as "note:" that must support spaces in the URL, there is an alternative. The "Monikers, URLs, Security Zones, and Pluggable Protocols" documentation in the InetSDK describes a more complete method for handling custom protocols. Following the directions therein related to creating a "Pluggable Protocol Handler" would allow any application to correctly handle any URL form. Please refer to this documentation for more information.

REFERENCES

Internet Client SDK: Internet Tools & Technologies; Monikers, URLs, Security Zones, and Pluggable Protocols; Overview; Appendix B: Registering an Application to a URL Protocol

Keywords          : kberrmsg
Technology        : kbInetDev internet
Version           : WINDOWS:4.0,4.01
Platform          : WINDOWS
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 6, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.