I've got another problem - for some it's probably very simple but I can't get over it...
There is a directory which may be either empty or have some subdirectories inside.
I do
FOR /F %%I IN ('DIR/A-D/B DIRECTORY') DO (
and get "file not found" output when there are no files inside. Is there any way to prevent it from being displayed? Normally it's just
DIR/A-D/B DIRECTORY >NUL
but here I don't know where to put >NUL.
The other problem is that I wont to do
IF NOT EXIST DIRECTORY\*.* (
but subdirectories are also treated as *.*. Is there a simple way to check if there are no files (excluding subdirs) in a directory?
This post has been edited by tomasz86: 08 August 2011 - 11:04 AM



Help


Back to top










