0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

勉強メモ50_Windowsコマンドを使ってフォルダの中で一番更新日付が新しいファイルのみ特定フォルダにコピーする

Posted at

0 はじめに

1 下記のWindowsコマンドを使って実施する。パスはその現場に合わせて書き換える

copy.bat
@echo on
for /F "tokens=1" %%F in ('dir C:\Users\rinchome\Desktop\aa /b /o:D /a:-d') do set fname=%%F
set hoge=%fname%
echo %hoge%
set hoge2=%hoge:~0,2%
echo %hoge2%
copy C:\Users\rinchome\Desktop\aa\%fname% C:\Users\rinchome\Desktop\aa\dst\%hoge2%
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?