Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

batch how to check if folder is empty

# BATCH HOW TO CHECK IF FOLDER IS EMPTY
for /F %%i in ('dir /b /a "folderpath*"') do (
    echo if you see this the folder is NOT empty
)
Comment

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
Comment

PREVIOUS NEXT
Code Example
Shell :: compress folder pigz 
Shell :: adapta ubuntu 
Shell :: TypeError: Could not load reporter "mochawesome" 
Shell :: code in terminal 
Shell :: batch file path 
Shell :: git view last commits 
Shell :: git stash file 
Shell :: git checkout -f 
Shell :: how to cat a file that has spaces 
Shell :: Merge Remote Repository With Local Repository in git command 
Shell :: Git lab global setup 
Shell :: du command 
Shell :: github auto close issue 
Shell :: free ram linux 
Shell :: grep capture group 
Shell :: regex for url in bash 
Shell :: git reset staged files 
Shell :: composer install from local directory 
Shell :: open bash 
Shell :: install wmctrl 
Shell :: gatsby plugin image 
Shell :: yarn upgrade 
Shell :: task manager ubuntu 
Shell :: how to remove a file from git but keep local and ignore file 
Shell :: edit commit message 
Shell :: bash remove string from string 
Shell :: delete from git history 
Shell :: unable to install all modules vmware ubuntu 20.04 
Shell :: video editor for ubuntu 21.10 
Shell :: install wp cli wp org 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =