tags:

views:

19

answers:

2

Hey-

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)?

Thanks-

Jonathan

+1  A: 

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.

krock
A: 

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.

Joey