Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make Firefox open a file with an ampersand in the filename?
    text
    copied!<p>I've written some Ruby code to inspect ZIP-files as part of an internal company process. The way we usually launch this code is from a web browser. When you click to download the file, you select "open with" and specify the full path to a small batch file. This one-line batch file looks like this:</p> <pre><code>\\mathworks\public\Matthew_Simoneau\ruby-1.8.7-p72-i386-mswin32\bin\ruby.exe "%~dp0inspect.rb" %1 </code></pre> <p>As far as I know, this technique is the only easy way to launch my Ruby code on a Windows machine which doesn't have Ruby installed, but does have access to the company internal filesystem.</p> <p>I'm having a problem when the filename of the ZIP file contains an ampersand.</p> <p>This works fine on IE and Chrome, where the above line gets "expanded" out to the following:</p> <pre><code>C:\WINNT\Profiles\matthew\Desktop&gt;\\mathworks\public\Matthew_Simoneau\ruby-1.8.7-p72-i386-mswin32\bin\ruby.exe "\\mathworks\public\Matthew_Simoneau\sandbox\inspect\inspect.rb" "C:\WINNT\Profiles\matthew\Local Settings\Temporary Internet Files\Content.IE5\VNATJ3X0\park&amp;park_paper_LMI_neuralN[1].zip" </code></pre> <p>On Firefox, however, everything after the ampersand in the filename gets dropped on the floor:</p> <pre><code>H:\&gt;\\mathworks\public\Matthew_Simoneau\ruby-1.8.7-p72-i386-mswin32\bin\ruby.exe "\\mathworks\public\Matthew_Simoneau\sandbox\inspect\inspect.rb" C:\Temp\park </code></pre> <p>I've tried putting the <code>%1</code> in quotes in the batch file, but that has no effect.</p> <p>I suspect this is a bug in Firefox. I've searched the Firefox bug list, but didn't find anything.</p> <p>Am I doing something wrong here? Is this a Firefox bug? If so, is there a way I can work around it? Is there a more robust way to launch my Ruby code from a web browser?</p> <p><strong>Update:</strong> I filed <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=514443" rel="nofollow noreferrer">a bug report</a> with Bugzilla@Mozilla, but there hasn't been a response yet.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload