How to loop through comma separated string in batch?

后端 未结 4 540
[愿得一人]
[愿得一人] 2020-12-09 15:46

Windows

Based on the post (dos batch iterate through a delimited string), I wrote a script below but not working as expected.

Goal: Given st

4条回答
  •  不知归路
    2020-12-09 16:29

    I took Aacini's answer and only slightly modified it to remove the quotes, so that the quotes can be added or removed as it would be in the desired command.

    @echo off
    set themes=Hot Sun,Hard Granite,Shimmering Bright Twilight
    for %%a in ("%themes:,=" "%") do (
        echo %%~a
    )
    

提交回复
热议问题