Answer the question
In order to leave comments, you need to log in
Batch file that defines a directory to be empty?
help, how to check the directory for emptyness using the bat command file, like if it is empty, display "yes" if it is not empty, display "no"
I tried everything, I don't know how to do it
Answer the question
In order to leave comments, you need to log in
@echo off
set dir=C:\aaa
set result=folder is empty
if exist "%dir%" for /f "usebackq" %%f in (`dir "%dir%\" /b /a:`) do set result=folder is not empty
echo %result%
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question