home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,166 of 42,547   
   foxidrive to Simon S Aysdie   
   Re: test for directory empty of files, n   
   01 Jul 15 13:42:25   
   
   From: foxidrive@server.invalid   
      
   On 1/07/2015 07:05, Simon S Aysdie wrote:   
   > I want to test if a directory has any files in it, but ignore subdirectories.   
      
   This is not perfect, but it may work for you.   
      
   @echo off   
   dir "d:\folder" /b/a-d 2>&1|find /i "file not found">nul   
   if errorlevel 1 echo I spy files!   
   if not errorlevel 1 echo no files   
   pause   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca