0

有没有办法将目录中最旧的文件重命名为“file_oldest”?
我不知道如何将日期与 ren cmd

4

1 回答 1

1

Here you go. It's a bit trickier for a UNC path.

@echo off
setlocal
set share=\\server\xxxx\xxxx\xxxx\xxxxx
for /f "tokens=*" %%a in ('dir "%share%" /b /a-d /o-d') do (set oldest="%%a")
ren "%share%\%oldest%" file_oldest
于 2013-05-22T16:45:48.867 回答