Windows 10: command line to copy files from dir A to B but skip existing ones

Discus and support command line to copy files from dir A to B but skip existing ones in Windows 10 Support to solve the problem; Hi there Is there a Windows command that can copy files from say directory A to directory B but skip any with the same name I don't want to update... Discussion in 'Windows 10 Support' started by jimbo45, Oct 23, 2016.

  1. jimbo45 Win User

    command line to copy files from dir A to B but skip existing ones


    Hi there

    Is there a Windows command that can copy files from say directory A to directory B but skip any with the same name I don't want to update even if say directory A has a newer version than directory B --simply use existing names --if it exists skip.

    I'm trying to replicate the Linux command :

    rsync -a -v --ignore-existing <src> <dst> where src is source directory and dst is destination / target directory (or device etc)

    (This command also has options to OVERWITE target directory with newer file -- I don't want that option yet - the example I gave will ignore existing files if they already exist in the target directory. Note also - this doesn't CARE what's in the files - it's purely on the NAME - no dates / attributes /size etc considerations are checked - simply the NAME - which is why this job can be lightning fast even for quite a lot of files.

    What I'm trying to do is automate sending files to a NAS server every so often (say once a day / week) from WINDOWS clients when new files have been created --I don't need to backup all the windows clients - users can do that themselves - There's a job on the Clients that can backup / restore their desktop in entirety which is run on demand.

    Any ideas --shouldn't be too hard but I don't really know too much of Windows possibilities from the CLI.

    Note I don't want a GUI --need a command as this will be (eventually) an automated background process on the Windows clients.

    I did see there's an experimental Bash interface - but putting that in the hands of inexperienced users would probably be a recipe for DISASTER !!!.

    Cheers
    jimbo

    :)
     
    jimbo45, Oct 23, 2016
    #1

  2. Windows 10 will not boot after automatic update. Here is what I have tried so far...

    A Windows 8.1 Command Prompt is fine.

    You can copy most of your files in one fell swoop.

    Your first task is to identify the drive letter used by Windows. It is usually C: but it could be any other letter but not drive X:. These commands will tell you:

    dir C:\win*

    dir D:\win*

    dir E:\win*

    etc.

    I shall call this S: (Source). On this drive there will be a folder S:\Users\Jarp (or similar).

    These commands tell you the letter for the external drive:

    dir D:\

    dir E:\

    etc.

    I shall call this T: (Target)

    This long command will copy your files to the external disk:

    for %a in (Desktop Downloads Music Pictures Videos) do robocopy "S:\Users\Jarp\%a" T:\%a /e /r:1 /w:1 /xj

    The command will not copy your favorites. Their location is browser-sensitive.

    The command may or may not copy your E-Mail files. Their location is mail client sensitive.
     
    Frederik Long, Oct 23, 2016
    #2
  3. n900 bricked during upate

    did you transfer the files into the maemo folder?

    once you are there in cmd line typr dir to get a list of whats in there

    also copy/paste the commands here that you are typing and as far as the error
     
    MatthewMaude, Oct 23, 2016
    #3
  4. Barman58 Win User

    command line to copy files from dir A to B but skip existing ones

    SyncToy is the app that comes to mind - If it's still available. Not command line but simple GUI *Wink

    What I've done in the past is create backup/update/copy routines until they are reliable and fine tuned to meet all eventualities then create a shortcut for each, (option is included in software), and this is all the user gets access to

    Download SyncToy 2.1 from Official Microsoft Download Center

    There is the robocopy command which may be of use if you have to use command line Try robocopy /?
     
    Barman58, Oct 23, 2016
    #4
  5. jimbo45 Win User
    Hi there

    Thanks for the suggestion -- looks good and probably best on offer - however I'm really trying to get a 100% background batch job to run --want it to be as automatic and as "user-proof" as possible.

    Thanks again for suggestion anyway as that program is good for other things too.

    I've had problems with Robocopy in the past --- could also be my fault (always RTFM !!!!!) but I might also give it another go.

    rsync is really good though if you use it properly --btw you must add a / to the end of the first directory in the source command or it will copy the WHOLE directory into the target -- e.g A will become A.A !!!! where A is within A.

    Cheers
    jimbo
     
    jimbo45, Oct 23, 2016
    #5
  6. Barman58 Win User
    Did you see my edit on Robocopy? It's not something I use but others swear by it. you could also use the shortcut data from Synctoy to use it inside a batch
     
    Barman58, Oct 23, 2016
    #6
  7. jimbo45 Win User
    Hi there.

    @Barman58

    The Robocopy scheme works -thanks --but :

    Robocopy doesn't seem have an option to ignore date / timestamp on output directory -- it says ignore if source older than dest OR ignore if source newer than dest. Not sure if you can combine these !!

    I'm trying to make 2 scenarios -- copy so long as file doesn't exist on target (any date), or copy regardless --i.e overwrite target if it exists.

    The users want to have a choice -- sometimes when copying files they are working on something and don't want the original to be overwritten. I know you can encourage them to create a new file until they've finished with their changes --but have you ever tried "Educating Users" !!!!!!!

    Pity Files don't have a thing like the IBM mainframes did where you had "generation" names automatically generated such as file_name(0), file_name(-1), file_name(+1) etc. !!

    Cheers
    jimbo
     
    jimbo45, Oct 23, 2016
    #7
  8. Barman58 Win User

    command line to copy files from dir A to B but skip existing ones

    You may be able to create two, (or several), different variations to overwrite or not, and create, and present, Short-cuts to the user, or probably, better for you, create a command line instruction from the shortcut to add to the batch files
     
    Barman58, Apr 5, 2018
    #8
Thema:

command line to copy files from dir A to B but skip existing ones

Loading...
  1. command line to copy files from dir A to B but skip existing ones - Similar Threads - command line copy

  2. Onedrive not copying from one folder to another if the file already exists.

    in Windows 10 Network and Sharing
    Onedrive not copying from one folder to another if the file already exists.: Since I upgraded to MS Edge as my browser I cannot copy a file from one folder to another within Onedrive if the file already exists in that second folder. When I did this before, it would copy the file and rename it by adding a number to it automatically. Now it just hangs...
  3. Bug in the DIR command?

    in Windows 10 Network and Sharing
    Bug in the DIR command?: Hi all. I'm running Version 10.0.17134.1365 and recently I've been testing long file names and how they're handled in an application that I work on. Strangely I noticed that when I try to see what the short name is for one of these files, they're not displaying correctly....
  4. Copy and skipping existing files.

    in Windows 10 Software and Apps
    Copy and skipping existing files.: Is there any way that I can copy files from one folder to another and automatically skipping all existing files in the destination folder using a batch file? I know I can do it usung File Explorer, but I want to know how to do it from a batch file. If I use the /v option,...
  5. Windows Gurus please command to copy all directories from Disk A to B

    in Windows 10 Support
    Windows Gurus please command to copy all directories from Disk A to B: Hi folks - especially Windows Gurus please Is there a Windows command to copy all the directories and their files and sub directories from one disk or directory to another -- not a CLONE disk but just a file and directory copy with recursion if necessary. It should ignore...
  6. DIR commands

    in Windows 10 Ask Insider
    DIR commands: So recently I used the DIR commands to be able to see hidden and Invisible files, is there any way to revert this? submitted by /u/Creeper_King_558 [link] [comments] https://www.reddit.com/r/Windows10/comments/inyfq2/dir_commands/
  7. How to use File Explorer "Copy path" on command line?

    in Windows 10 Network and Sharing
    How to use File Explorer "Copy path" on command line?: If I highlight files in File Explorer then select "Copy path", it will copy the path of one or more files to the clipboard. For example below I highlighted 3 files then selected "Copy path" which copied the path of the 3 files to the clipboard. Can someone explain to me...
  8. Cannot dir in My Documents folder from a command line

    in Windows 10 Network and Sharing
    Cannot dir in My Documents folder from a command line: I am the owner of My Documents, and I have Full Control. I can use Windows Explorer to navigate inside this folder, but whether I use Command Prompt or Powershell, I cannot use the dir command. Command Prompt says "File Not Found." PowerShell gives a long error message that...
  9. Running a Command Line Command From a File Automatically

    in Windows 10 Installation and Upgrade
    Running a Command Line Command From a File Automatically: I have the following commands which need to be run in the command line: sc.exe config wuauserv start= disabled sc.exe stop wuauserv I want to create a file which, when launched, opens the command line, sends the above commands to the command line, and then closes the...
  10. GUI for copy files from A to B that don't exist on B

    in Windows 10 Software and Apps
    GUI for copy files from A to B that don't exist on B: Hi there while this is easy in Linux : (rsync -a -v --ingnore -existing /dir/a/ /dir/b) you need the '/' after first directory) some people prefer a GUI There's now a front end GUI for this (works on Windows too) called Grsync [img] Grsync And GAdmin-Rsync: The...