Topic "New postlanzar winscp.com desde un .bat"

Author Message
sudanahi
[View user's profile]

Joined: 2015-01-20
Posts: 2
Hola, estoy intentado lanzar un .bat que lo que hace es abrir la consola de winscp y traerse un fichero de una maquina al local de mi equipo pero no consigo hacerlo.Si lo hago manualmente a traves de la consola de windows(cmd) me sale correctamente pero en cambio si lo lanzo a través del .bat no funciona. El .bat contiene lo siguiente;

@echo off
echo open sftp://usuario:pasword@Ipmaquina:puerto/ -hostkey="ssh-rsa 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX" > prueba.tmp
echo lcd C:\Directorio >> prueba.tmp
echo cd directorio >> prueba.tmp
echo get fichero.txt >> prueba.tmp
echo exit >> prueba.tmp

WinSCP.com /script= prueba.tmp
pause
sudanahi
[View user's profile]

Joined: 2015-01-20
Posts: 2
Hi, I'm trying to launch a .bat that it does is open the console winscp and bring a file from one machine to the place of my computer but I can not do it manually hacerlo.Si through the windows console (cmd) me but instead come out correctly if released through the .bat does not work. The .bat contains the following;

echo off
open cast sftp: // user: pasword @ Ipmaquina: port / -hostkey = "ssh-rsa 1024 XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX "> prueba.tmp
Echo lcd C: \ Directory >> prueba.tmp
Echo cd directory >> prueba.tmp
Echo get file.txt >> prueba.tmp
echo exit >> prueba.tmp

WinSCP.com / script = prueba.tmp
pause
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24555
Location: Prague, Czechia
sudanahi wrote:
open cast sftp: // user: pasword @ Ipmaquina: port / -hostkey = "ssh-rsa 1024 XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX: XX "> prueba.tmp

This should probably be:
echo open sftp://user@password@Ipmaquina:port/ -hostkey="ssh-rsa 1024 XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX" > prueba.tmp
I.e. you are missing an echo. Not sure what the cast was supposed to do. And you need to avoid all those spaces.
_________________
Martin Prikryl
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