Copy a file from a Windows command line

Advertisement

brianpaul
Joined:
Posts:
1
Location:
NY

Copy a file from a Windows command line

I would like to copy a file from a Windows machine to a Linux machine(10.0.0.5). I thought maybe this would be a way I could do it...
winscp.com root:password@10.0.0.15 /synchronize d:/esxupdates/updates /home/scripts/updates
I also tried this...
winscp.com root:password@10.0.0.15 /synchronize d:/esxupdates/updates /home/scripts/updates /defaults
If /upload would work for my purpose, then that would be even better. I can copy the file by opening up a connection with the Linux server and then entering in the commands, but I would like one command-line statement to do this so I can put it into a VB program.
Thanks!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: Copy a file from a Windows command line

If you want to automate the transfer, use scripting functionality:
winscp.com /command "open sftp://root:password@10.0.0.15" "put d:/esxupdates/updates /home/scripts/updates/" "exit"
(edited to up-to-date syntax in 2022)

Reply with quote

guest
Guest

Re: Copy a file from a Windows command line

I tried to use winscp.com in command line, it showed the following error msg:
'winscp.com' is not recognized as an internal or external command, operable program or batch

Reply with quote

Advertisement

martin
Site Admin
martin avatar

Re: Copy a file from a Windows command line

@guest: You have to run the command from folder, where winscp.com is located. Or ensure that winscp.com is in search PATH.

Reply with quote

Peyotito
Guest

Re: Copy a file from a Windows command line

I have problems with root:password@10.0.0.15
How can I use special characters like SPACE / ! " – or else?

I mean in Username and/or password.

i.e. if I use a / in my password it cuts it off

Greets
P.

Reply with quote

RakeshRaushan
Guest

File transfer using command mode from Windows to Unix

Hi, I want to transfer files from my Windows folder to Unix server (using PuTTY). Currently I am using WinSCP GUI but I want to use commands instead of using GUI. Please suggest if any way is there.

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum