How to create a folder with name as current date in batch (.bat) files

前端 未结 24 1299
被撕碎了的回忆
被撕碎了的回忆 2020-12-08 02:26

I don\'t know much about windows .bat file syntax. My simple requirement is to create a folder at a specific location with name as current date. I tried searching this on go

24条回答
  •  猫巷女王i
    2020-12-08 02:43

    Try this (an equivalent of bash backquotes):

    for /f "tokens=1* delims=" %%a in ('date /T') do set datestr=%%a
    mkdir %datestr%
    

    For further information, see http://ss64.com/nt/for_cmd.html

提交回复
热议问题