1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Dos Batch File help for a noob.

Discussion in 'DOS/Other' started by dosdude, Feb 14, 2007.

Thread Status:
Not open for further replies.
  1. dosdude

    dosdude Thread Starter

    Joined:
    Feb 14, 2007
    Messages:
    2
    Hey,
    I'm using a program that is called input, it inputs the information the user types in and makes it into a container with a container name.

    So for this demonstration, I have a container name called file - %file% which holds the filename (eg: command.com) and another container called %dirpath% which holds the directory path the user put in.

    So say the user puts in the file command.com then the container - %file%=command.com
    If the person put in the directory c:\ then the %dirpath%=c:\

    Ok? Now, I have two files, my main program bat file (main.bat) and a copyif.bat (another batch file)

    So my problem is, how do I use a FOR look in main.bat to pass each and every file from the specified directory, one at a time, with the specified string to the copyif.bat file.

    The copyif.bat must use replaceable parameters to recieve the directory and string. Copyif.bat will test to see if the file name contains the specified string, if it does copy the file to the current directory.
    IF the file doesn't contain the specified string, it will do nothing.
     
  2. dosdude

    dosdude Thread Starter

    Joined:
    Feb 14, 2007
    Messages:
    2
    neone?
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Similar Threads - Batch File help
  1. niedernsill
    Replies:
    3
    Views:
    229
  2. minimustangs
    Replies:
    5
    Views:
    1,197
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/544028

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice