Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Getting error "Winscp is not recognized as an internal or external command"

The batch file looks ok. Works for me.

Do you have WinSCP installed to C:\Program Files (x86)\WinSCP\?
bala_ganesh

Getting error "Winscp is not recognized as an internal or external command"

Hi All,

Please find below my script. If I run the commands separately, I am not facing any issue. But I saved the script with .bat extension. I am getting "Winscp is not recognized as an internal or external command" while running the batch file. Please let me know what mistake I am doing.

@echo off

set x=%DATE:~0,3%
set y=%x%__catalog
SET y
CALL :LoCase y
SET y

cd "C:\Program Files (x86)\WinSCP\"
WinSCP.com /console /command "option batch on" "option confirm off" "open sourcing" "cd /catalog/USA/" "get %y%.txt D:\Scripts\Catalog\USA\" "exit"

LoCase
FOR %%i IN ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z") DO CALL SET "%1=%%%1:%%~i%%"
GOTO:EOF

exit