Topic "copy a file from a windows machine to a linux machine"

Author Message
kmcguine

Guest


I am trying to use a command line to copy a file from a windows machine to a linux machine, but I can not get to file to copy to a different directory other than the home directory. The command line I am using is:
"c:\Program Files (x86)\WinSCP\winscp.exe" /command "option batch on" "option confirm off" "open userid:password@remotelinuxmachine" "put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXMF017_2435611\CNXMF017_2435611*.PDF" "cd /home/psoft/psreports/devcop/" "/log=C:\Users\tuxadm\test.log" "exit"

The script works fine except that I can't copy to /home/psoft/psreports/devcop/, it copies to /home/psoft/ .

Thanks,
Karen
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Use:
"put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXMF017_2435611\CNXMF017_2435611*.PDF /home/psoft/psreports/devcop/"
_________________
Martin Prikryl
Guest




Thanks, I was having trouble where to place the quotes. After making your suggested change, I am still having trouble. I'd like to copy the entire directory. Can I do this? Do the wildcards work with the put command?

"put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXPO404_2437814\*.* /home/psoft/psreports/devcop/"


prikryl wrote:
Use:
"put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXMF017_2435611\CNXMF017_2435611*.PDF /home/psoft/psreports/devcop/"
Guest




I believe the problem may be related to winscp is running under the "system" account. I need it to run under the user I am logged into the machine as.

Do you have any suggestions?

Thanks


Anonymous wrote:
Thanks, I was having trouble where to place the quotes. After making your suggested change, I am still having trouble. I'd like to copy the entire directory. Can I do this? Do the wildcards work with the put command?

"put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXPO404_2437814\*.* /home/psoft/psreports/devcop/"


prikryl wrote:
Use:
"put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXMF017_2435611\CNXMF017_2435611*.PDF /home/psoft/psreports/devcop/"
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Anonymous wrote:
Thanks, I was having trouble where to place the quotes. After making your suggested change, I am still having trouble. I'd like to copy the entire directory. Can I do this? Do the wildcards work with the put command?

"put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXPO404_2437814\*.* /home/psoft/psreports/devcop/"

You seem to have the command right.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Anonymous wrote:
I believe the problem may be related to winscp is running under the "system" account. I need it to run under the user I am logged into the machine as.

Do you have any suggestions?

Not sure what kind of suggestion you ask for.
_________________
Martin Prikryl
Dennisdr

Guest


kmcguine wrote:
I am trying to use a command line to copy a file from a windows machine to a linux machine, but I can not get to file to copy to a different directory other than the home directory. The command line I am using is:
"c:\Program Files (x86)\WinSCP\winscp.exe" /command "option batch on" "option confirm off" "open userid:password@remotelinuxmachine" "put C:\Users\tuxadm\psft\pt\8.51\appserv\prcs\PSNTDEV\log_output\SQR_CNXMF017_2435611\CNXMF017_2435611*.PDF" "cd /home/psoft/psreports/devcop/" "/log=C:\Users\tuxadm\test.log" "exit"

The script works fine except that I can't copy to /home/psoft/psreports/devcop/, it copies to /home/psoft/ .

Thanks,
Karen
Very Happy


It help us a lot in making a batch file....thank a lot
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