I have a requirement in which I need to replace a specific character from a string using the DOS command.
For example, if my string is "1,2,3,4", I need to get the result "1.2.3.4", replacing each "," with ".". character.
The following will work for you
@echo off set string1=1,2,3,4 set string2=%string1:,=.% echo %string2%
This will give you an idea of ββwhat to do without knowing exactly how to start the line.
set str=1,2,3,4 set str=%str:,=.%