Skip to content

Instantly share code, notes, and snippets.

@gitcrtn
Created July 13, 2015 05:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gitcrtn/7fb8e37ca00144b3283e to your computer and use it in GitHub Desktop.
Save gitcrtn/7fb8e37ca00144b3283e to your computer and use it in GitHub Desktop.
ファイルの更新日時を、別のファイル作成のためのファイル名にする
for %%i in ("%filename%") do set date=%%~ti
set date=%date:/=-%
set date=%date::=-%
set date=%date: =_%
echo date filename test > %date%.txt
pause
for %%i in ("%filepath%") do set date=%%~ti
for %%i in ("%filepath%") do set drive=%%~di
for %%i in ("%filepath%") do set folder=%%~pi
set date=%date:/=-%
set date=%date::=-%
set date=%date: =_%
echo date filename test > %drive%%folder%%date%.txt
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment