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. mikeincousa Win User

    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 disappointed ...

    in Browsers and Email
    Very disappointed ...: Disappointed that Microsoft ***still*** hasn't fixed the window position problem for Edge in their latest update for Windows 10 (10586.104). The problem of Edge not remembering its last window position has been present since day one of Windows 10's release, and it still...
  3. Excel files open very slowly

    in Microsoft Office and 365
    Excel files open very slowly: Hi, I have installed windows 10 pro a couple of days ago and I now experience a strange behavior from excel (office 2013). I suspect this worked when booting new OS for the first time. When I open any excel file from any location on any hard drive (ssd or hdd) it takes...
  4. 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...
  5. 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,...
  6. 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...
  7. Duplicate Files with very odd file extensions

    in Windows 10 Support
    Duplicate Files with very odd file extensions: That's a relief, is the ransomware PROTECTION, on Acronis very good? If I may continue with my original reason for posting, for some reason my computer became near unusable and I installed clones of each drive, then the problem with duplicate files, I could not find a...
  8. 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...
  9. FIle Explorer - Very weird problem.

    in Windows 10 Support
    FIle Explorer - Very weird problem.: Running Windows 10 x64 Pro RTM will all updates. In a nutshell everytime I bring up File Explorer in normal mode it appears in a new position. It is always a little lower down and a little to the right. I have a dual monitor setup even though I doubt this is the problem....
  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...