Windows 10: Wildcards in Robocopy | Batch file very very basics

Discus and support Wildcards in Robocopy | Batch file very very basics in Windows 10 Support to solve the problem; I have folders that contain files and subfolders. The files have a limited set of extensions. What I seek to do is to robocopy /mir the files... Discussion in 'Windows 10 Support' started by mikeincousa, Sep 28, 2018.

  1. Wildcards in Robocopy | Batch file very very basics


    I have folders that contain files and subfolders. The files have a limited set of extensions.

    What I seek to do is to robocopy /mir the files separately from the subfolders. I have been trying to review wildcard basics. I am not finding any ways to combine them that suits this goal.

    I was thinking something like robocopy source directory files with *.txt (comma or &&) *.pdf…. *.svg….. destination /mir

    If push comes to shove I can build a series of commands in a spreadsheet with one for each extension.

    From what I have seen a batch file would be a cleaner method. Guess I need to go there sooner than later now.

    I am vaguely recalling that I need some basic code that defines a variable, indexes the extensions, and runs a for next loop?

    I found this discussion but quickly became lost in the details. Maybe I am in the wrong place?
    Robocopy and For loops in batch file
    ex.
    for /f %%i in (c:\temp\comps.txt) do robocopy.exe c:\file_ini "\\%%i\c$\Program Files\usbdlm" usbdlm.ini

    I get "for". Do not get "%%." "In" would be the source file? "do" is the execution command? The rest is somehow setting the destination? Does not this need some sort of "next" until or something like that.

    Any guidance or background that speaks to the mission will be appreciated.

    Thanks.

    :)
     
    mikeincousa, Sep 28, 2018
    #1
  2. Binky_875 Win User

    Repeat RoboCopy batch file in Windows 10 gives different results.

    Action taken as suggested.

    Same question now exists here
    HERE
    .
     
    Binky_875, Sep 28, 2018
    #2
  3. Binky_875 Win User
    Repeat RoboCopy batch file in Windows 10 gives different results.

    Running Windows 10 Pro 64 bit with standard supplied RoboCopy.

    Having said that, I believe the same symptoms were exhibited on Windows 7 Ultimate 64bit (which was updated).

    Basically I have a batch file which copies data from a 'non changing (by the OS)' drive to a backup drive.

    If it has been run and completed so both drives are in sync, I can run the batch file again and it runs very quickly, BUT can sometimes give a different number of files in the drive. i.e. running it back to back gives different file count, even when the
    2 drives are in sync.

    Either this is related to caching of the drives, or RoboCopy not counting correctly when using multiple threads.

    I would appreciate a definitive answer so that I can automatically test for files that are synced and provide a YES/NO to it having worked okay.

    Regards Binky
     
    Binky_875, Sep 28, 2018
    #3
  4. fpefpe Win User

    Wildcards in Robocopy | Batch file very very basics

    Robocopy switches

    Hello -- one of the many switches that robocopy has is /xf -- to exclude file(s) that are to copy (not) copied --- the help (https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy) note that I can specify "wildcards
    * and ? for the filename ---

    So I specified the option

    /xf foo.*

    and I got a error that this option was invalid

    Strictly speaking is the help noted that the filename, ie the part of the file identifier before the '.' can have the wildcard and not

    the file extension/type?

    Thanks in advance
     
    fpefpe, Sep 28, 2018
    #4
Thema:

Wildcards in Robocopy | Batch file very very basics

Loading...
  1. Wildcards in Robocopy | Batch file very very basics - Similar Threads - Wildcards Robocopy Batch

  2. Very, very slow internet

    in Windows 10 Network and Sharing
    Very, very slow internet: Good Morning For the past week I have been having problems with internet pages being very slow to load, having to be constantly refreshed to display the content and often not displaying the content at all despite repeated attempts. I have had my telephone line and...
  3. File Explorer is very slooooow

    in Windows 10 Performance & Maintenance
    File Explorer is very slooooow: I am running W10 Pro on a new build PC with plenty of resources but still the File Explorer is very slow. Ive seen a hundred different opinions/posts about how to speed up File Explorer but I thought I'd ask the experts. Most of the files I deal with are videos. When I have...
  4. File Explorer is very slooooow

    in Windows 10 Support
    File Explorer is very slooooow: I am running W10 Pro on a new build PC with plenty of resources but still the File Explorer is very slow. Ive seen a hundred different opinions/posts about how to speed up File Explorer but I thought I'd ask the experts. Most of the files I deal with are videos. When I have...
  5. File manager very slow

    in Windows 10 BSOD Crashes and Debugging
    File manager very slow: In the last week or so certain operations whilst using File Manager are going very slow. I'm using a fully updated version of Windows 10 on a PC. Opening a file manager window works okay, but clicking 'New Folder' takes 20 seconds for the folder to appear. Deleting a file to...
  6. Very, very, very, slow to open network share with many files

    in Windows 10 Network and Sharing
    Very, very, very, slow to open network share with many files: I have a Win10 PC on my network with some shared directories, the "server". The share I use most has 23,000 files in 600 folders. When I access that share from a Win 7 PC it opens pretty much instantly, but to open it from my Win 10 PC takes for ever. The green progress bar...
  7. Very very weird issue

    in Windows 10 Support
    Very very weird issue: I bet you never heard of that... every time i turn on the computer, everything runs slow, very slow, like if in place of my Samsung 850 pro SSD, there would be a floppy disk unit... but, and this is the weird part, if I launch an utility called passmark performance test,...
  8. Windows 10 is very very very dangerous

    in Windows 10 Support
    Windows 10 is very very very dangerous: I always back up my computer, that is not a problem, However, after Windows gets to version 10 it should be able to handle minor tasks. I downloaded 10 from Microsoft and did the upgrade. - Many people do not install form scratch as it is very time consuming and today's...
  9. Robocopy syntax doesn't work in my batch file anymore

    in Windows 10 Support
    Robocopy syntax doesn't work in my batch file anymore: I created the following text file & then changed the extension to .bat. The syntax is: Robocopy "C:\Users\Phil\AppData\Roaming\Thunderbird\Profiles\MyProfile" "E:\Backups\Thunderbird\Profiles\MyProfile" /MIR /Z /W:5 /TS /MOT:180 /R:10 I also created a shortcut for it on...
  10. Very broken.

    in Windows 10 Support
    Very broken.: Hi, everything worked fine for a few days. Nothing changed, nothing installed. Edge stopped working, Cortana stopped working. Mail stopped working. SFC scannow found corrupt files but unable to fix. Reset keep files and settings failed to boot and rolled back. As did remove...