http://qs1969.pair.com?node_id=11134019


in reply to Re: Windows and backslashes and replacements oh my!
in thread Windows and backslashes and replacements oh my!

Which is weird for Windows. ..

it's not even a little bit weird. Variable expansion is basic job of shells.

turn it off in your batch files

SETLOCAL DISABLEDELAYEDEXPANSION

help setlocal

  • Comment on Re^2: Windows and backslashes and replacements oh my!

Replies are listed 'Best First'.
Re^3: Windows and backslashes and replacements oh my!
by LanX (Saint) on Jun 18, 2021 at 20:36 UTC
    > it's not even a little bit weird. Variable expansion is basic job of shells.

    The discussion was about "escape sequences" with \ not "variable expansion".

    The escape meta in bat is ^ not \

    And \ is - unfortunately - used as path separator in win, which rules out any use as escape character.°

    Anything else would be indeed "weird", because it would make using paths impossible!

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

    °) see Escape_character#Windows_Command_Prompt