There is a parameter passed in cmd in the format "ARG=CUSTOM_SOURCE,SOURCE=C:\Folder\OtherFolder\SourceFiles" . In order to highlight ARG and SOURCE with their values, you must convert the parameter to the format ARG=CUSTOM_SOURCE,SOURCE=C:\Folder\OtherFolder\SourceFiles
Code:
set test=%1 for /f "delims=" %%A in ("!test!") do set "test=%%~A" echo test after process is "%test%" rem output: ""ARG=CUSTOM_SOURCE,SOURCE=C:\Folder\OtherFolder\SourceFiles"" :nextVar for /F "tokens=1* delims=," %%a in ("%test%") do ( set %%a set test=%%b ) if defined test goto nextVar set test=%ARG% Also tried this option:
set test=%test:"=% The result is the same: ""ARG=CUSTOM_SOURCE,SOURCE=C:\Folder\OtherFolder\SourceFiles""
Where is the mistake? How to remove quotes?