http://www.perlmonks.org?node_id=965788

bontyal has asked for the wisdom of the Perl Monks concerning the following question:

hello all I'm trying to write an FTP script that will use a Mget to locate text files on ftp site then either open a batch file or if i can just unzip the file straight from the script i wont need to use the batch file. this is what i have so far
ftp << EOD open 192.168.10.100 user username password lcd C:\ftp mget testfile1 #EOD :restart Copy copy *.zip T:\FTP-EDS\Storage\ @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode :restart Move move *.zip T:\FTP-EDS @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode :restart Cd cd /d T:\FTP-EDS @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode :restart Del del XEDS /q @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode :restart Unzip T:\FTP-EDS\Batch\winrar e -pBSCU14CNS *.zip @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode :restart delzip del *.zip /q @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode :restart rename ren *.* XEDS @set retcode=%errorlevel% @if NOT %ERRORLEVEL% == 0 goto :retcode thanks in advance
alex

Replies are listed 'Best First'.
Re: UC4 FTP
by chilledham (Friar) on Apr 18, 2012 at 20:15 UTC

    Welcome to Perlmonks, bontyal!

    I don't see anything Perl related in your question. While many monks here in the Monastery are experts in non-Perl topics your question will be better posed to another forum, perhaps http://stackoverflow.com/.

    That said, seeing UC4 in your title leads me to believe you're working with some sort of scheduler of theirs. Could their support staff be of assistance to you?

      You can use unix shell scripts, or you perl to accomplish this. It looks like you are trying to build this using UC4 code use a scripting or unix like language. Much easier.
        If you still need help with this please respond I can send you some code examples, but DUMP the UC4 code yuck.