How to copy folders using wildcards

Page 2 of 2 FirstFirst 12

  1. Posts : 8
    windows 7 ultimate 64 bit
    Thread Starter
       #11

    that was close it copied the directory structure but it didn't copy any of the files inside the folders
      My Computer


  2. Posts : 1,800
    Windows 7 Pro x64 SP1
       #12

    dsikirica try

    xcopy p:\client\12*.* z:\clientbak\ /e /i /s

    The /m works only once until you reset the archive bit. Happens all the time when it fails the first
    time. The archive bit gets set and the /m tells it that it already has been archived.

    Rich
      My Computer


  3. Posts : 8
    windows 7 ultimate 64 bit
    Thread Starter
       #13

    it copied all of the folders in the whole client directory, not just the ones that start with 12, it only copied 2 files under those folders, and they weren't the files in the 12*.* folders., is there anything you can think of that i need to do on my end different these are mapped drives and if it matters the folders are on two different servers, clients is on server x and clientbak is on server y
      My Computer


  4. Posts : 3,371
    W10 Pro desktop, W11 laptop, W11 Pro tablet (all 64-bit)
       #14

    This is the closest I could get, try this in a batch file:

    for /d %%a in (\client\12*) do xcopy "%%a" "z:\clientbak\%%a" /E /I

    Use %a instead of %%a to run it from the command line.

    This copies only the 12 folders & files BUT it copies them to clientbak\client. I wasn't able to get around that.
      My Computer


  5. Posts : 8
    windows 7 ultimate 64 bit
    Thread Starter
       #15

    thanks so much, this works perfectly
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 23:21.
Find Us