Hi

NB: Not off-topic!

I'm trying to build a one-click solution to switch between various Perl versions on Win for my colleagues.

Using portableshell.bat from strawberries portable versions works very good so far.

It will basically add the needed PATHs in %PATH%

C:\perls\strawberry-perl-5.32.1.1-64bit-portable\perl\site\bin;C:\perls\strawberry-perl-5.32.1.1-64bit-portable\perl\\bin;C:\perls\strawberry-perl-5.32.1.1-64bit-portable\c\bin;C:\Windows\system32;... etc

To make this even more idiot proof (talking about me not my colleagues ;) I'd like to purge all older entries from PATH C:\perls\*;

My BAT-Shell knowhow is limited, I was only able to find a weak solution by replacing C:\perls\ with a dummy DISABLED to "sabotage" those entries, but it'll keep ugly artifacts in the PATH. (I doubt this will insert much of a performance penalty)

So is there a good way to delete those older entries?

(off course I could spawn a perl one-liner, but the basic idea of BAT is to keep the delay minimal)

Thanks

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

PS: Yes I know about berrybrew, and I will look into it. But for the time being we need to extend this solution to support ActiveState too.


In reply to Cleaning %PATH% with WinBatch by LanX

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.