automation and scripting

Advertisement

hunter
Joined:
Posts:
5
Location:
San Jose

automation and scripting

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 :( [/b]

Reply with quote E-mail

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: automation and scripting

hunter wrote:

C:\WinSCP.exe /log /console /wait /open mharper@192.168.166.29 /get test c:\test_bat
You probably meant to do:
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?

Reply with quote

Guest

Re: automation and scripting

martin 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:
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 :D

Reply with quote

Guest

Re: automation and scripting

Anonymous wrote:

martin 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:
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 :D

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?

Reply with quote

hunter
Joined:
Posts:
5
Location:
San Jose

Re: automation and scripting

martin 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:
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 8)

Reply with quote E-mail

Advertisement

JRB_BMB
Joined:
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.

Reply with quote

Advertisement

You can post new topics in this forum