CopyFile With Wildcards?

This is a discussion on CopyFile With Wildcards? within the Windows Programming forums, part of the Platform Specific Boards category; I am sure I have used the equivalent function in .NET to do this but on Visual C++ 6 it ...

  1. #1
    Registered User
    Join Date
    Nov 2010
    Posts
    18

    CopyFile With Wildcards?

    I am sure I have used the equivalent function in .NET to do this but on Visual C++ 6 it doesn't like me trying to copy files using a wildcard to a new directory.

    Like:

    ::CopyFile("C:\\test\\test*.txt", "C:\\new\\" FALSE);

    Does this not work in VC6? If not what alternatives are there?
    Last edited by Jonnster; 11-25-2010 at 04:50 AM.

  2. #2
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Use this - FindFirstFile Function (Windows)

    Then call CopyFile on each

  3. #3
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    612
    SHFileOperation takes wildcards in it params, the strings must be double-null terminated though.
    Last edited by adeyblue; 11-25-2010 at 10:23 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Files and wildcards
    By MacNilly in forum C Programming
    Replies: 3
    Last Post: 08-11-2007, 04:42 PM
  2. Trying to get my App to copy files with wildcards
    By Dwizard in forum Windows Programming
    Replies: 3
    Last Post: 09-30-2005, 06:49 PM
  3. CopyFile()
    By magic in forum Windows Programming
    Replies: 7
    Last Post: 09-23-2003, 12:56 AM
  4. extracting files from a rar/zip
    By jverkoey in forum Windows Programming
    Replies: 2
    Last Post: 03-28-2003, 08:55 AM
  5. Wildcards, again
    By Echidna in forum Windows Programming
    Replies: 2
    Last Post: 12-11-2001, 12:41 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21