CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2006
    Posts
    1

    Unhappy MSDOS BAT Problem

    Hello,

    I need to check if a file in my D:\somedir directory begins with "app..." and if it begins then need to rename it to somename. I also need to do this until there is no more file left in this directory.

    Can anyone help.

  2. #2
    Join Date
    Mar 2006
    Location
    New Jersey
    Posts
    120

    Unhappy Re: MSDOS BAT Problem

    I can't think of any way to do that with in MS-DOS.

  3. #3
    Join Date
    Mar 2006
    Posts
    1

    Re: MSDOS BAT Problem

    Since you will be using batch, one of the easiest programing laguages ever, you might wanna use an If statement, such as

    If file_name = "app.." Then

    ************

    End if

    I am not sure this is the setup for an If statement in batch, but it would be easier to do this in VB, or possibly C,C#, or C++.

  4. #4
    Join Date
    May 2002
    Posts
    10,943

    Re: MSDOS BAT Problem

    Brenton S. is correct. This cannot be done just using DOS. You can however script it very easily or use QBASIC or Visual Basic. Just about any language can do this.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

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

Featured