Tag Archives: for command

Cmd.exe: Workaround for “if not exist *.*” and other uses for the FOR command

      Comments Off on Cmd.exe: Workaround for “if not exist *.*” and other uses for the FOR command

One of the annoying things in Windows XP/2003 and later, is that the construct if not exist c:\test\*.* echo No files! does not work as expected if c:\test is empty. This seems to be due to the fact that Windows regards the “.” and “..” file entries as valid files… Read more »