urwlcm

比如,从下面的文件夹中找出第一个以file_1_1开头的txt文件(文件名按字母顺序排序)

image

代码可以这样写

@echo off
setlocal enabledelayedexpansion

set path=D:\Workspace\Test\Data
for /f "delims=" %%i in (\'dir /a-d /b /on %path%\file_1_1*.txt\') do (
   set filename=%%i
   goto next
)
:next
echo %filename%

分类:

技术点:

相关文章:

  • 2021-08-09
  • 2021-08-08
  • 2021-09-21
  • 2021-09-30
  • 2021-12-05
猜你喜欢
  • 2021-11-27
  • 2021-12-13
  • 2021-04-21
  • 2021-08-08
  • 2021-12-23
  • 2021-10-19
  • 2021-06-25
相关资源
相似解决方案