Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to run SCP on my Windows box through a batch file.

I want to do something like:

scp "C:\myfile.txt" user@host:path

Of course scp thinks that "C" is my source host and "\myfile.txt" is my source path. I can't seem to find a way to escape the colon.

These don't work:

scp "C\:\myfile.txt" user@host:path
scp "C::\myfile.txt" user@host:path
scp "C^:\myfile.txt" user@host:path

SCP man pages suggest that using the "absolute or relative pathname" should eliminate this problem but I'm using the absolute pathname and this is still an issue. They likely mean it eliminates the problem on *nix where absolute and relative pathnames start with "/" or ".".

Suggestions (aside from throwing my Windows box off the freaking roof)?

share|improve this question

migrated from stackoverflow.com Jun 2 '11 at 0:38

This question came from our site for professional and enthusiast programmers.

2 Answers 2

If your working dir is in C: you should be able to specify \myfile.txt. If you are using MinGW you could try \c\myfile.txt. If you are using cygwin then /cygdrive/c/myfile.txt should work.

share|improve this answer

You could use pscp, though. The PuTTY author seems to put a lot more effort into making sure that his programs run on Windows while many native Unix software gets ported very poorly, as you note.

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.