Cannot run script from command line or .bat file

Advertisement

Uyenvu123
Joined:
Posts:
1
Location:
Viet Nam

Cannot run script from command line or .bat file

Hi guys

I am very new to scripting and am having difficulty in getting my script to run. I have read through the guides, FAQ and forum postings and there must be something that I am missing. I need to download remote files to a specific local directory and then move the remote files to a different remote directory. The script is below.

option batch on
option confirm off
open StoredSession
cd claim
get *.txt h:\123\ABC\Temp
mv *.txt complete/
close exit

The script is called script.txt and is located in c:\Scripts
I have tried running the script from the command prompts as:
winscp.com /script.txt
AND
winscp.com /%Scripts%"\sctipt.txt"

in each case winscp.com loads and requests the host. Ultimately I want to call this script from a .bat file so that I can automate the daily download.

I appreciate and help and advice you can offer.

Uyen

Reply with quote

Advertisement

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

Re: Cannot run script from command line or .bat file

Uyenvu123 wrote:

The script is called script.txt and is located in c:\Scripts
I have tried running the script from the command prompts as:
winscp.com /script.txt
AND
winscp.com /%Scripts%"\sctipt.txt"
It should be:
winscp.com /script=script.txt
See
https://winscp.net/eng/docs/guide_automation#script_file
or
https://winscp.net/eng/docs/commandline#scripting

Reply with quote

Advertisement

You can post new topics in this forum