Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

I run a portable edition of Strawberry Perl (under Windows 8.1) invoked by the batch file portableshell.bat which contains the following line:

set PATH=%drivep%\perl\site\bin;%drivep%\perl\bin;%drivep%\c\bin;%PATH +%

This has been working well. However, after updating MySQL and installing MySQL Workbench, I now have a directory:

C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5

which has also been added to the PATH environment variable. Now, when I open a normal Windows command prompt, the PATH is set correctly; but when I run portableshell.bat the ampersand in the directory name is interpreted as a “special character” and the path is truncated.

Google search has led me to the following suggested fixes:

  • Escape the ampersand with a caret: \MySQL Fabric 1.5 ^% MySQL Utilities 1.5
  • Quote the directory name in the PATH variable
  • Quote the assignment in the batch file: set "PATH=...;%PATH%"

I’ve tried these in various permutations, but so far nothing works. :-(

Yes, I could rename the directory, but I’m afraid this will break, e.g., MySQL Notifier.

So, is there an equivalent of quotemeta for Windows batch files? Or another workaround?

Thanks,

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,


In reply to [OT] Invoking Perl via batchfile: ampersand in PATH [Solved] by Athanasius

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-03-28 17:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found