Re: Looping

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: David Trimboli (trimboli_at_cshl.edu)
Date: 12/22/04

  • Next message: Al Dunbar [MS-MVP]: "Re: Novice Script Question"
    Date: Wed, 22 Dec 2004 11:59:10 -0500
    
    

    Franck Diastein wrote:
    > Hi,
    >
    > I want to list files in a directory, how to do it ?
    >
    > If I do this:
    >
    > for %%f in (c:\svn_bak\dumps\*.*) do echo %%f
    >
    > I have files with full path... I only need file names...
    >
    > TIA

    Umm . . .
            dir /a-d /b c:\svn_bak\dumps

    Or, if you actually do need only files with "." in them:
            dir /a-d /b c:\svn_bak\dumps\*.*

    If you want to list directories too, choose one of these:
            dir /b c:\svn_bak\dumps
            dis /b c:\svn_bak\dumps\*.*

    Unless I'm missing some point you were trying to make? Why are you
    using FOR?

    David
    Stardate 4976.6


  • Next message: Al Dunbar [MS-MVP]: "Re: Novice Script Question"

    Relevant Pages

    • Re: Looping
      ... Franck Diastein wrote: ... > I want to list files in a directory, ... > TIA ... Gruesse Greetings Saludos Saluti Salutations ...
      (microsoft.public.win2000.cmdprompt.admin)
    • Re: Looping
      ... Matthias Tacke wrote: ... > Franck Diastein wrote: ... >> I want to list files in a directory, ... >> TIA ...
      (microsoft.public.win2000.cmdprompt.admin)