Topic "automation and scripting"

Author Message
hunter
[View user's profile]

Joined: 2008-09-10
Posts: 5
Location: San Jose
I am trying to automate winscp. I am able to verify manually in DOS that the commands work. but as a batch file or from the scheduler I get left at the

active session: [1] mharper@192.168.166.29
winscp>

At the winscp prompt I can manually get my files but not able to automate that part of the process.

Also I am not able to get the log to create.


C:\WinSCP.exe /log /console /wait /open mharper@192.168.166.29 /get test c:\test_bat


As a batch file it seems that the wait is needed to get the login to work but from the scheduler it runs ok with out the wait.

What I am trying to do is get files from a remote server and completely automate the process on an hourly basis. I have tried many variations nothing seems to work.

all my commands work from the Command line but fail after logging into the server.


Mark Sad [/b]
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
hunter wrote:
C:\WinSCP.exe /log /console /wait /open mharper@192.168.166.29 /get test c:\test_bat

You probably meant to do:
Code:
c:\winscp.exe /log=c:\winscp.log /console /command "open mharper@192.168.166.29" "get test c:\test_bat"

There is no "wait" command in WinSCP. Where did you find that?
Guest




prikryl wrote:
hunter wrote:
C:\WinSCP.exe /log /console /wait /open mharper@192.168.166.29 /get test c:\test_bat

You probably meant to do:
Code:
c:\winscp.exe /log=c:\winscp.log /console /command "open mharper@192.168.166.29" "get test c:\test_bat"

There is no "wait" command in WinSCP. Where did you find that?


what do the quotes do? the wait is a dos command that seemed the only way for the actual batch file to get logged into the session.
I will apply those changes and see what happens.


Mark Very Happy
Guest




Anonymous wrote:
prikryl wrote:
hunter wrote:
C:\WinSCP.exe /log /console /wait /open mharper@192.168.166.29 /get test c:\test_bat

You probably meant to do:
Code:
c:\winscp.exe /log=c:\winscp.log /console /command "open mharper@192.168.166.29" "get test c:\test_bat"

There is no "wait" command in WinSCP. Where did you find that?


what do the quotes do? the wait is a dos command that seemed the only way for the actual batch file to get logged into the session.
I will apply those changes and see what happens.


Mark Very Happy


OK its almost there. I ran the scheduler with the changed paramters but it is trying to pull binaries. and not file is transfered. I am only moving text files is there an adjustment I can use to get that to happen?
hunter
[View user's profile]

Joined: 2008-09-10
Posts: 5
Location: San Jose
prikryl wrote:
hunter wrote:
C:\WinSCP.exe /log /console /wait /open mharper@192.168.166.29 /get test c:\test_bat

You probably meant to do:
Code:
c:\winscp.exe /log=c:\winscp.log /console /command "open mharper@192.168.166.29" "get test c:\test_bat"

There is no "wait" command in WinSCP. Where did you find that?


actually it all works the file test_bat was a typo on my part and it created a new folder with that name. I added an exit to the scheduler and all is well. I will be trying it on a batch file next and it looks good.

The one thing that I would like to understand is the quotes and what do they do?


Thanks so much for your help.

Mark Cool
JRB_BMB
[View user's profile]

Joined: 2008-07-01
Posts: 24
Location: Midlands, UK
The quotes encapsulate the command into a single string that the program can use and doesn't count them all as little chunks.
So it sees;
open mharper@192.168.166.29
get test c:\test_bat

and not;
open
mharper@192.168.166.29
get
test
c:\test_bat

Hope that makes sense.
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