Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to copy files from a folder on a server using a batch file. However I don't want the files in the destination folder to be overridden. This is what i have:

set /p address=ip address:
pscp -pw "password" "username"@%address%:/folder path/* c:\folderpath

This works however when it runs it overrides the files in the destination folder. Is there a way to make it skip over the files that are already in the destination folder?

share|improve this question
See also:…,,… - the general suggestion seems to be 'use rsync instead'. Another suggestion is to use scp to transfer to a temporary directory and use a server-side script to copy things without overwriting. I imagine it would also be possible to use ssh to check for the existence of files in a client-side script, but that sounds a little tedious. – Bob Apr 13 '13 at 7:31
See also:… - yea, another rsync suggestion. – Bob Apr 13 '13 at 7:36

The SCP protocol isn't very sophisticated. The sending side can only blindly send the files and directories to the receiver. There's no standard option to avoid overwriting files on the destination.

You should look at more sophisticated transfer protocols, like SFTP or rsync as in the comments.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.