cmd line rename file with date and time

后端 未结 7 1543
余生分开走
余生分开走 2020-12-14 11:03

Project moving forwards, I can see why creating .bat files to do things can become addictive! I can now save somefile.txt at regular intervals, I then rename somefile.txt by

7条回答
  •  伪装坚强ぢ
    2020-12-14 11:32

    problem in %time:~0,2% can't set to 24 hrs format, ended with space(1-9), instead of 0(1-9)

    go around with:

    set HR=%time:~0,2%

    set HR=%Hr: =0% (replace space with 0 if any )

    then replace %time:~0,2% with %HR%

    good luck

提交回复
热议问题