Copy a file from a Windows command line

Advertisement

brianpaul
Joined:
Posts:
2
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:
28,507
Location:
Prague, Czechia

Re: Copy a file from a Windows command line

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

Reply with quote

brianpaul
Joined:
Posts:
2
Location:
NY

Re: Copy a file from a Windows command line

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?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,507
Location:
Prague, Czechia

Re: Copy a file from a Windows command line

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

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
28,507
Location:
Prague, Czechia

Re: Copy a file from a Windows command line

For automation please read FAQ.
_________________
Martin Prikryl

Reply with quote

guest
Guest

Re: Copy a file from a Windows command line

martin 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

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,507
Location:
Prague, Czechia

Re: Copy a file from a Windows command line

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

Reply with quote

Peyotito
Guest

Re: Copy a file from a Windows command line

martin 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.

Reply with quote

Advertisement

Peyotito
Guest

Re: Copy a file from a Windows command line

I mean in Username and/or password.

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

Reply with quote

RakeshRaushan
Guest

file transfer using command mode from windows to unix(putty)

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

martin
Site Admin
martin avatar
Joined:
Posts:
28,507
Location:
Prague, Czechia

Re: file transfer using command mode from windows to unix(putty)

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)

Reply with quote

Advertisement

Ravindranadh
Guest

is there any way to copy files from windows to linux using command line.

From Linux machine i want to copy windows files. Can some one please help me to get command line process.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
28,507
Location:
Prague, Czechia

Re: is there any way to copy files from windows to linux using command line.

Ravindranadh wrote:

From Linux machine i want to copy windows files. Can some one please help me to get command line process.
The easiest is to have WinSCP generate the script for you:
https://winscp.net/eng/docs/ui_generateurl#script

Reply with quote

Advertisement

You can post new topics in this forum