meiszp 当前离线
二级士官
buyiyang 当前离线
中尉
TOP
aloha20200628 当前在线
上尉
77七 当前离线
中校
@echo off for /l %%l in (0,1,5) do ( call :1 %%l if errorlevel 3 ( echo [errorlevel=%%l ^>=3] ) else ( echo [errorlevel=%%l ^<3] ) ) pause exit :1 exit /b %1复制代码
for %%F in (*.txt) do ( findstr /i "abc" "%%F">nul if errorlevel 0 (echo,有》%%F) else (echo,无》%%F) )复制代码
setlocal enabledelayedexpansion for %%F in (*.txt) do ( findstr /i "abc" "%%F">nul if !errorlevel! equ 0 (echo,有》%%F) else (echo,无》%%F) )复制代码
for %%F in (*.txt) do (findstr /i "abc" "%%F">nul&&echo,有》%%F||echo,无》%%F)复制代码
ShowCode 当前离线
VIP1
@echo off findstr /m "error" *.txt if errorlevel 1 ( echo 不包含 ) else ( echo 包含 ) pause复制代码
@echo off for %%i in (*.txt) do ( findstr "error" "%%i" >nul 2>&1 if errorlevel 1 ( echo "%%i" 不包含 ) else ( echo "%%i" 包含 ) ) pause复制代码
@echo off for /f "delims=" %%i in ('dir /b /a-d *.txt') do ( findstr "error" "%%i" >nul 2>&1 if errorlevel 1 ( echo "%%i" 不包含 ) else ( echo "%%i" 包含 ) ) pause复制代码