Results 1 to 2 of 2

Thread: batch file to search and locate

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Location
    London Occupation: Desktop Developer
    Posts
    141

    batch file to search and locate

    I am trying to write a batch file to look for a file on a drive and if its not there then create one.

    Was thinking of using dir with /s to locate the file but then how do I capture weather or not I have found it..

    very new to this so any help much appreciated.

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Something like this perhaps

    Code:
    Dir somefile.txt /s
    If it's there, you'll see the directory, if not, then you wont.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width