Link to home
Start Free TrialLog in
Avatar of AlHal2
AlHal2Flag for United Kingdom of Great Britain and Northern Ireland

asked on

Converting FTP script to SFTP

The code below allows me to log into an FTP server decide which directory I want and delete some files.
Please could you enable it to work on an SFTP server?
Set HostName=xx
set USERID=xx
set PWD=xx
set ScriptDir=xx
set FTPSCRIPT=%ScriptDir%\$tempftp$.$$$

echo open %HOSTNAME%>%FTPSCRIPT%
echo user %USERID% %PWD%>>%FTPSCRIPT%
echo cd newdirectory\subdirectory

echo mdel *.*>>%FTPSCRIPT%


echo bye >>%FTPSCRIPT%
ftp -i -n -s:%FTPSCRIPT%

Open in new window

Avatar of rbartczak
rbartczak
Flag of Poland image

you can use sftp from command line:
http://winscp.net/eng/docs/commandline
Avatar of AlHal2

ASKER

Is it possible to do this without downloading any software?
ASKER CERTIFIED SOLUTION
Avatar of rbartczak
rbartczak
Flag of Poland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AlHal2

ASKER

Thanks.