@echo off&setlocal EnableDelayedExpansion
set x=0
for /f "delims=" %%f in ('dir /b /s ??.jpg') do (set /a n=%%~nf*1
if !n!==%%~nf set /a x+=1)
echo 纯数字99以内的jpg数量:%x% 个
echo.&pause
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in ('dir/ad/b') do (
set x=
for /f "tokens=*" %%j in ('dir/b "%%i\*.jpg"') do (
set /a n=%%~nj
if !n! gtr 0 if !n! lss 100 set /a x+=1)
echo %%i文件夹 !x!张)
pause
Option Explicit
'添加事件
Private WithEvents cmd As CommandButton
Private Sub Form_Load()
Set cmd = Controls.Add("VB.CommandButton", "cmd")
cmd.Visible = True
End Sub
@echo off
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in ('dir/b/ad') do (
for /f %%j in ('dir/ad/b "%%i"^|find /c /v ".*"') do set d=%%j
for /f %%j in ('dir/a-d/b "%%i\*.jpg"^|find /c /v ".*"') do set f=%%j
echo 文件夹%%i下有!d!个文件夹下有jpg.共有jpg文件!f!张.)
pause