Athanasius has asked for the wisdom of the Perl Monks concerning the following question:
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, |
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: [OT] Invoking Perl via batchfile: ampersand in PATH
by Discipulus (Canon) on Nov 02, 2015 at 09:32 UTC | |
by Athanasius (Archbishop) on Nov 02, 2015 at 09:55 UTC | |
Re: Invoking Perl via batchfile: ampersand in PATH ( this.bat )
by Anonymous Monk on Nov 02, 2015 at 09:43 UTC | |
by Athanasius (Archbishop) on Nov 02, 2015 at 10:09 UTC | |
by Anonymous Monk on Nov 02, 2015 at 10:21 UTC | |
Re: [OT] Invoking Perl via batchfile: ampersand in PATH
by syphilis (Archbishop) on Nov 02, 2015 at 09:51 UTC | |
by Athanasius (Archbishop) on Nov 02, 2015 at 09:59 UTC |