Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: need batch file for reading file names and chekcing the file name  (Read 2580 times)

0 Members and 1 Guest are viewing this topic.

mahesh_goli

  • Guest
need batch file for reading file names and chekcing the file name
« on: September 03, 2009, 03:20:33 AM »
Hi All,

I need some urgent help..

I have one file files.lst, it will contain filenames,dialy the number of filenames  will be change.

let us assume that this file.lst has following file names

a.dat \b.dat
c.dat

I need a batch file , it has to read this file names from filename.lst and has to check a.dat file is there or not in c:\informatica\srcfiles
folder

like that it has to check all the file names mentioned  in file.lst



could you please help me to write a batch file

Thanks

Mahesh Goli

T.C.



    Beginner

    Thanked: 13
    Re: need batch file for reading file names and chekcing the file name
    « Reply #1 on: September 03, 2009, 09:20:37 PM »
    You seem to have given three input file names Files.lst, File.lst and Filename.lst so uncertain that this is what you want:

    Code: [Select]
    @echo off
    cls

    setlocal

    set path=c:\informatica\srcfiles\

    for /f "delims=" %%# in (files.lst) do (
        if not exist %path%\%%# (echo ----- %%# does NOT exist in %path% -----
        ) else (
        echo +++++ %%# DOES exist in %path% +++++
    )
      )       
    endlocal