本帖最后由 qixiaobin0715 于 2021-2-4 16:32 编辑
回复 1# 18831281895
只会纯批,比较麻烦点。抛砖引玉:- @echo off
- setlocal enabledelayedexpansion
- for /d %%i in (*) do (
- for /f "tokens=1,2 delims=.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" %%a in ("%%i") do (
- if %%a lss 10 (set str1=0%%a) else set str1=%%a
- if %%b lss 10 (set str2=0%%b) else set str2=%%b
- set #!str1!!str2!=%%i
- )
- )
- set n=0
- for /f "tokens=2 delims==" %%j in ('set #') do (
- set /a n+=1
- if !n!==1 set var1=%%j
- set var2=%%j
- )
- echo,!var1!
- echo,!var2!
- pause
复制代码
|