Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

batch file code detects if folder is empty or not

@echo off
color 02
setlocal
set _folder="C:Demo"
for /F %%A in ('dir /b /a %_folder%') Do (
    Echo The folder is NOT empty
    pause
    goto exit
)
echo The folder is empty
pause
goto exit
:exit
exit
Source by ss64.com #
 
PREVIOUS NEXT
Tagged: #batch #file #code #detects #folder #empty
ADD COMMENT
Topic
Name
5+2 =