Struggling with Script

Advertisement

SteveHale
Joined:
Posts:
2
Location:
Farnham, Surrey

Struggling with Script

Hi
I have set up a schedule on a W10 machine and entered this Action:

open ftp://derekwei@repackagingservices.co.uk:WeiH0NgK0Ng!/ put C:\Users\ShaunMBragg\OneDrive\Buy Easy\WeiDailyOrders.csv /home/Daily Orders/

However the script comes up with an error saying that the OPEN command fails:
Host "open" does not exist.
When I force the script to run I can see WinSCP opens and then the error occurs.
I am wanting a file to be daily uploaded to the FTP server.
Can anyone help?

Cheers

Steve B

Reply with quote

Advertisement

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

Re: Struggling with Script

SteveHale wrote:

Hi
I have set up a schedule on a W10 machine and entered this Action:

open ftp://derekwei@repackagingservices.co.uk:WeiH0NgK0Ng!/ put C:\Users\ShaunMBragg\OneDrive\Buy Easy\WeiDailyOrders.csv /home/Daily Orders/
Do I understand right, that you put the above as parameters of winscp.exe?
That's a wrong syntax.
See https://winscp.net/eng/docs/guide_schedule
Also, WinSCP GUI can generate command-line template for you:
https://winscp.net/eng/docs/ui_generateurl

Reply with quote

SteveHale
Joined:
Posts:
2
Location:
Farnham, Surrey

Problem with Script

Hi Martin
I thought I had followed the commands on the page that you have given me a link to. I went there before the script.
I've gone back to the MS Scheduler and checked that it is calling WinSCP.exe and entered/amended the following action:

/console /log=C:\Users\ShaunMBragg\Desktop\winscp.log /command "derekwei%40repackagingservices.co.uk:WeiH0NgK0Ng%21@repackagingservices.co.uk/" "put C:\Users\ShaunMBragg\OneDrive\Buy Easy\WeiDailyOrders.csv /home/Daily Orders/" "exit"

When I run the schedule I can see that the console briefly opens, but despite the fact that the file does not run no log file is placed on the desktop and of course the transfer fails.

The thing is I am not a programmer so I cam trying my best to understand how the script will work to automatically pick up a daily file, log into the FTP server, transfer that file, then exit.

Kind regards

Steve B

Reply with quote

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

Re: Problem with Script

The most obvious problem is that you are missing open command:
/console /log=C:\Users\ShaunMBragg\Desktop\winscp.log /command "open derekwei%40repackagingservices.co.uk:WeiH0NgK0Ng%21@repackagingservices.co.uk/" "put C:\Users\ShaunMBragg\OneDrive\Buy Easy\WeiDailyOrders.csv /home/Daily Orders/" "exit"
Again, have WinSCP GUI generate a command-line template for you:
https://winscp.net/eng/docs/ui_generateurl

Reply with quote

Advertisement

You can post new topics in this forum