相关疑难解决方法(0)

How to find the last directory created in batch

This is my first question and I'm not very experienced using batch files so hope someone can help.

I want to find the last directory created using a batch file and have tried:

FOR /f "tokens=*" %%A in ('dir "%latestdirectory%" /AD-h /B /o-d') do (set recent=%%A)
Run Code Online (Sandbox Code Playgroud)

but this result keeps returning the oldest directory not the most recent one.

Still trying to pick this up in batch.

windows directory datetime cmd batch-file

5
推荐指数
1
解决办法
1376
查看次数

使用批处理文件,我需要知道特定位置的最新文件夹名称

我有一个网络位置,从那里我需要知道创建的最新文件夹的名称。我想使用批处理文件来做。任何帮助都会很棒

batch-file

2
推荐指数
1
解决办法
3929
查看次数

标签 统计

batch-file ×2

cmd ×1

datetime ×1

directory ×1

windows ×1