Pergunta

I am trying to ftp a text file from a Unix machine to a Windows machine. In the process, the data is getting mangled. I want to try transfering the file in binary instead of ASCII - hopefully that will make the data pass thru without getting corrupted.

How can I modify the following script to make the .txt file transfer as a binary file, instead of ASCII? I am not familiar with the syntax.

@echo off
setlocal
set uname=john
    set passw=password
    set hostname=johncomputer
    set filespec=SampleSPEC
echo %uname%>                     name.ftp
echo %passw%>>                    name.ftp
echo cd CRMD>>                    name.ftp
echo get %filespec%>>             name.ftp
echo bye>>                        name.ftp
ftp -s:name.ftp %hostname%
if errorlevel 1 pause
endlocal
Foi útil?

Solução

Try: echo TYPE I >> name.ftp before the line that adds the get command.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top