By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!v:\> touch /c "a,b"
2017-05-17 00:53:43.424 V:\a,b
v:\> ren "a,b" a_b
V:\a,b -> V:\a_b
1 file renamed
v:\> do f in "a,*" (ren "%f" %@replace[^,,_,%f])
V:\a,b -> V:\a_b
1 file renamed
do f in "a_*" (ren "%f" %@replace[_,^,,%f])
a_b -> V:\ab
You could just rename the file. :-)
Code:v:\> touch /c "a,b" 2017-05-17 00:53:43.424 V:\a,b v:\> ren "a,b" a_b V:\a,b -> V:\a_b 1 file renamed
In any case, you'll have to rename it sooner or later. As you thought, escaping the comma in @replace works with little fuss.
v:\> do f in "a,*" (ren "%f" %@replace[^,,_,%f])Code:v:\> do f in "a,*" (ren "%f" %@replace[^,,_,%f]) V:\a,b -> V:\a_b 1 file renamed
V:\a,b -> V:\a_b
1 file renamed
do f in "a_*" (ren "%f" %@replace[_,^,,%f])
do f in "a_*" (ren "%f" "%@replace[_,^,,%f]")