>
> "Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> wrote in message
> news:uG12vSWpHHA.716[ at ]TK2MSFTNGP05.phx.gbl...
> >
> > "Richard Mueller [MVP]" <rlmueller-nospam[ at ]ameritech.nospam.net> wrote in
> > message news:eBFKdGSpHHA.4112[ at ]TK2MSFTNGP04.phx.gbl...
> >> Jurgen Heijnen wrote:
> >>
> >>> Can someone help me creating a script which search for files which
> >>> contains
> >>> a certain string in the filename. the files are placed in 1 directory
> >>> and
> >>> there names differ,
> >
> > I would hope that their names would differ - if not then they'd all be the
> > same file.
> >
> >>> an example: 2383737.2006.01.csv of 4443335.2007.04.csv.
> >>> Now I need to search the directory for the filename which contains the
> >>> string
> >>> "2007.04", which stands for "april 2007".
> >>> Can somebody help or get me started
> >>
> >> I have an example VBScript program that does this linked here:
> >>
> >>
http://www.rlmueller.net/FindFiles.htm> >
> > Or, at a command prompt:
> >
> > dir {folder}\*.2007.04.csv
> >
> > Or if you want to have a script do something with the file once found,
> > something like this in a batch script:
> >
> > pushd {folder}
> > (set _ym=Enter year and month in yyyy.mm format: )
> > for %%F in (*.%_ym%.csv) do notepad %%F
> >
> >
> > /Al
> >
>
> Reading Al's answer I just realized I mis-understood the question. The
> script I linked searches for files that have a specified string in the file
> contents, not in the name of the file. The "dir" command seems the best
> solution.
>
> --
> Richard Mueller
> Microsoft MVP Scripting and ADSI
> Hilltop Lab -
http://www.rlmueller.net> --
>
>
>