1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to? Check folder for "No files except possibly ..."

Discussion in 'T&T - Miscellaneous' started by Rick Reinckens, Aug 21, 2017.

  1. Rick Reinckens

    Joined:
    Oct 18, 2009
    Messages:
    96
    Likes Received:
    4
    I'm trying to find out if there is a fairly short way to check if folder X:\C-Import is empty except possibly for files named CMNT-*.CSV

    The \C-Import folder doesn't have subfolders, so the existence of subdirectory names isn't an issue.

    ISFILE and @expand don't seem to have an "exclude" syntax.

    I realize I could dir X:\C-Import\*.*>zzq_temp.txt, then check the file line-by-line, then delete the temp file and return a Yes or No. But it seems there should be an easier way.
     
  2. samintz

    samintz Scott Mintz

    Joined:
    May 20, 2008
    Messages:
    1,191
    Likes Received:
    11
    Look in the help under Exclusion Ranges.
    help filexranges

    something like this:
    Code:
    dir /[!CMNT-*.CSV]
    
     

Share This Page