Topic "Copy a file from a Windows command line"

Author Message
brianpaul
[View user's profile]

Joined: 2007-10-18
Posts: 2
Location: NY
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!
Advertisements
Guest




My friend Sebastian says that you can't do that on the command line.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
If you want to automate the transfer, use scripting functionality:
winscp.com root:password@10.0.0.15 /command "put d:/esxupdates/updates /home/scripts/updates/"
_________________
Martin Prikryl
brianpaul
[View user's profile]

Joined: 2007-10-18
Posts: 2
Location: NY
That works very well, but it prompts me if I want to overwrite the file. Is there a switch that can be used that would allow the command to overwrite without prompting? Also, is there a switch or someway to have it close the session when the command is completed?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
brianpaul wrote:
That works very well, but it prompts me if I want to overwrite the file. Is there a switch that can be used that would allow the command to overwrite without prompting? Also, is there a switch or someway to have it close the session when the command is completed?

option confirm off
exit
Please read documentation.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
For automation please read FAQ.
_________________
Martin Prikryl
guest

Guest


prikryl wrote:
If you want to automate the transfer, use scripting functionality:
winscp.com root:password@10.0.0.15 /command "put d:/esxupdates/updates /home/scripts/updates/"


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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
guest wrote:
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

You have to run the command from folder, where winscp.com is located. Or ensure that winscp.com is in search path.
_________________
Martin Prikryl
Peyotito

Guest


prikryl wrote:
If you want to automate the transfer, use scripting functionality:
winscp.com root:password@10.0.0.15 /command "put d:/esxupdates/updates /home/scripts/updates/"


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

Greets

P.
Peyotito

Guest


I mean in Username and/or password.

i.e. if I use a / in my password it cuts it off
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
Peyotito wrote:
How can I use special characters like " SPACE / ! " or else?

Please read documentation:
https://winscp.net/eng/docs/session_url
_________________
Martin Prikryl
RakeshRaushan

Guest


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.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
RakeshRaushan wrote:
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.

Start here:
https://winscp.net/eng/docs/guide_automation

Or have WinSCP generate the script for you:
https://winscp.net/eng/docs/ui_generateurl
(available in the latest beta version only)
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License