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. "dir/s/b" Command Prompt not picking-up all the files in a directory.

    in Windows 10 Gaming
    "dir/s/b" Command Prompt not picking-up all the files in a directory.: I'm using the command in Command Prompt that goes "[a directory] > dir/s/b > [to a text-file]". When applying this to certain folders in the Windows OS—"C:\Users\Administrator\""C:\ProgramData\Packages\""C:\Windows\ServiceState\"in particular—it doesn't manage to get the...
  3. "dir/s/b" Command Prompt not picking-up all the files in a directory.

    in Windows 10 Software and Apps
    "dir/s/b" Command Prompt not picking-up all the files in a directory.: I'm using the command in Command Prompt that goes "[a directory] > dir/s/b > [to a text-file]". When applying this to certain folders in the Windows OS—"C:\Users\Administrator\""C:\ProgramData\Packages\""C:\Windows\ServiceState\"in particular—it doesn't manage to get the...
  4. DIR Command

    in Windows 10 Gaming
    DIR Command: dir /A:D /B /S > FolderList.txt produces a list of all directories and subdirectories of a directory. I would like to modify this line to have the date included for all directories and subdirectories of a directory too....
  5. Command-line shells, commands like dir /p not working but dir does work

    in Windows 10 Customization
    Command-line shells, commands like dir /p not working but dir does work: I am using W'10, Administrative Windows Power Shell, command line.When I do a "DIR" it works, but when I add parameters, I get this error message:-----------------PS C:\> dir /sdir : Cannot find path 'C:\s' because it does not exist.At line:1 char:1+ dir /s+ ~~~~~~ +...
  6. Command-line shells, commands like dir /p not working but dir does work

    in Windows 10 Gaming
    Command-line shells, commands like dir /p not working but dir does work: I am using W'10, Administrative Windows Power Shell, command line.When I do a "DIR" it works, but when I add parameters, I get this error message:-----------------PS C:\> dir /sdir : Cannot find path 'C:\s' because it does not exist.At line:1 char:1+ dir /s+ ~~~~~~ +...
  7. Command-line shells, commands like dir /p not working but dir does work

    in Windows 10 Software and Apps
    Command-line shells, commands like dir /p not working but dir does work: I am using W'10, Administrative Windows Power Shell, command line.When I do a "DIR" it works, but when I add parameters, I get this error message:-----------------PS C:\> dir /sdir : Cannot find path 'C:\s' because it does not exist.At line:1 char:1+ dir /s+ ~~~~~~ +...
  8. 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,...
  9. 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...
  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...