Using windows CopyFile function to copy all files with certain name format

Posted by Ben313 on Stack Overflow See other posts from Stack Overflow or by Ben313
Published on 2010-06-11T21:09:08Z Indexed on 2010/06/11 21:12 UTC
Read the original article Hit count: 239

Filed under:
|
|

Hello! I am updating some C code that copys files with a certain name. basically, I have a directory with a bunch of files named like so:

AAAAA.1.XYZ
AAAAA.2.ZYX
AAAAA.3.YZX
BBBBB.1.XYZ
BBBBB.2.ZYX

Now, In the old code, they just used a call to ShellExecute and used xcopy.exe. to get all the files starting with AAAAA, they just gave xcopy the name of the file as AAAAA.* and it knew to copy all of the files starting with AAAAA. now, im trying to get it to copy with out having to use the command line, and I am running into trouble. I was hoping CopyFile would be smart enough to handle AAAAA.* as the file to be copied, but it doesnt at all do what xcopy did. So, any Ideas on how to do this without the external call to xcopy.exe?

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows