Topic "Does "/command" work from a command-prompt in Windows???"

Author Message
HelpMe!
[View user's profile]

Joined: 2006-10-05
Posts: 3
OK, so I run the following from a command-prompt,

winscp3 scp://myusername:mypassword@myhostname/myremotepath /command "put c:\myfile.dat"

It connects to the "myhostname" just fine, but it doesn't copy the "myfile.dat" file to the host. I do not want to create a script for such a simple task. Any ideas why I can't get it to copy the file?

Thanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
What version of WinSCP are you using?
_________________
Martin Prikryl
HelpMe!
[View user's profile]

Joined: 2006-10-05
Posts: 3
Thanks for replying prikryl. I currently have "Version 3.8.2 (Build 330)" installed on a Windows XP machine.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Can you post an output of the command on console?

Also,
would it work, if you use:
winscp3 scp://myusername:mypassword@myhostname/myremotepath /script=script.txt
and script.txt contains
put c:\myfile.dat
?
HelpMe!
[View user's profile]

Joined: 2006-10-05
Posts: 3
prikryl wrote:
Can you post an output of the command on console?

Also,
would it work, if you use:
winscp3 scp://myusername:mypassword@myhostname/myremotepath /script=script.txt
and script.txt contains
put c:\myfile.dat
?


Here's the output,

C:\Temp>winscp3.com scp://user1:password1@myhost.com/pub/data /command "put file1.txt"
Initialisation...
Searching for host...
Connecting to host...
Authenticating...
Using username "user1".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] user1@myhost.com
winscp>

It does work with if I create a "script.txt" file that contains put C:\file1.txt. However, I would prefer not to do that since I'm trying to run this command from within a PERL script.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Sorry, I've totally forgot that you cannot combine URL-like session parameter with the /command parameter. See documentation for more details. But you can do:
winscp3.com /command "open scp://user1:password1@myhost.com/pub/data" "put file1.txt"
_________________
Martin Prikryl
Guest




prikryl wrote:
Sorry, I've totally forgot that you cannot combine URL-like session parameter with the /command parameter. See documentation for more details. But you can do:
winscp3.com /command "open scp://user1:password1@myhost.com/pub/data" "put file1.txt"


Thank you so much! Works flawlessly! I really appreciate all of your assistance!
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