1.

Solve : Batch with Ascii Art and FTP Login... need help?

Answer»

Hi,

i would like to create a batch for ftp login... But i want also that i can enter a special dir-name and after login into this dir all files should be leeched...
sry 4 my bad english i'm out of practice for some years:)

So here is my script...

Code: [Select]echo off

echo    _____    ___________________
echo   /  _  \  /   _____/\______   \
echo  /  /_\  \ \_____  \  |     ___/
echo /    |    \/        \ |    |
echo \____|__  /_______  / |____|
echo  arCi's \/  SiTE  \/  PROJECT
echo
echo   PRiVAT & SECURE SiNCE 2K8
echo.
echo Please input a Scene-Release:
set /p rel=
echo.
echo Release was set on ASP
echo.
echo Ready for Connection? (Y/N)
set /p answer=
if %answer% == Y goto con
if %answer% == N goto end
:end
exit
:con
clear
echo    _____    ___________________
echo   /  _  \  /   _____/\______   \
echo  /  /_\  \ \_____  \  |     ___/
echo /    |    \/        \ |    |
echo \____|__  /_______  / |____|
echo  arCi's \/  SiTE  \/  PROJECT
echo.
echo   PRiVAT & SECURE SiNCE 2K8
echo.
echo.
echo  establish Connection...
echo.
ftp xxx.xxx.xxx.xxx xxxxx
USER
USERPW
cd incoming/%rel%
REM mget -r * (mit a besteatigen)

I think the Problem was the ascii art... can MAYBE use the echo command like this... echo "ascii here..." ?

hope anyone got some HINTS for me

thx arCiYou need to put your FTP commands into a SCRIPT file and then execute the FTP command with the script file you created.
http://technet.microsoft.com/en-us/library/bb490910.aspxok but what's with the "set /p rel=" part? If i got this in the first script does it work also for the "ftp-script"?
And whats with the "echo-error"?

that's confusing me:)This is what the end of your batch file should look like.
Code: [Select](Echo.open ftp.somedomain.com
Echo.user username
Echo.password
Echo.cd incoming/%rel%
echo.mget -r *
Echo.quit
)>ftpscript.scr

ftp.exe -n -i -s:ftpscript.scrok i've put the ftp stuff into another file and got just the last line in my first file...

ftp.exe -n -i -s:asp.ftp

I think that should be work... I'll check it now


//EDIT

if i run asp.bat i get this error....
Code: [Select]D:\>asp
   _____    ___________________
  /  _  \  /   _____/\______   \
Der Befehl "___" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Still Problem with the ascii-art... How can i fix this? Quote from: arcanus on February 13, 2012, 11:48:28 AM

if i run asp.bat i get this error....
Code: [Select]D:\>asp
   _____    ___________________
  /  _  \  /   _____/\______   \
Der Befehl "___" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
Still Problem with the ascii-art... How can i fix this?

Your third ASCII art line has this character |

This is the pipe symbol.

Echo blablabla | lalala

means pipe text blablabla to program lalala

So the ascii art after the pipe symbol is triggering the error. Because there is no program named "___".

Escape the pipe symbols with a caret so | becomes ^|

Also escape < and > if you use them.





Quote from: arcanus on February 13, 2012, 11:48:28 AM
ok i've put the ftp stuff into another file and got just the last line in my first file...

ftp.exe -n -i -s:asp.ftp

I think that should be work... I'll check it now
But that forces you to hard code the directory you need to change to.  You cannot ask for it in your batch file now.Ok now it works... the asp.bat works well but i set on this file a path with:

set /p rel=

And in the ftp file i want go to this dir with

cd blabla/%rel%

this doesn't work... how can i make this working?


greetz arCi Quote from: arcanus on February 14, 2012, 09:09:55 AM
Ok now it works... the asp.bat works well but i set on this file a path with:

set /p rel=

And in the ftp file i want go to this dir with

cd blabla/%rel%

this doesn't work... how can i make this working?


greetz arCi
I gave you the code in my 2nd post and then told you about your issue in my 3rd post.  You need to create the FTP script on the fly with the code I gave you.i know and i make 2 files...

1 File with the asciiart in (asp.bat)

1 File with the ftp Stuff (asp.ftp)

the ftp file looks like this now:

Code: [Select]open xxx.xxx.xx.xx xxxxx
user username
password
cd incoming/%rel%
mget -r *
quit
i removed the echo. commands because it won't work with that.


Here is the asp.bat file:

Code: [Select]echo off

echo    _____    ___________________
echo   /  _  \  /   _____/\______   \
echo  /  /_\  \ \_____  \ ^|     ___/
echo /   ^|    \/        \^|   ^|
echo \___^|__  /_______  /^|___^|
echo  arCi's \/  SiTE  \/  PROJECT
echo.
echo   PRiVAT + SECURE SiNCE 2K8
echo.
echo Please input a Scene-Release:
set /p rel=
echo.
echo Release was set on ASP
echo.
echo Ready for Connection? (Y/N)
set /p answer=
if %answer% == Y goto con
if %answer% == N goto end
:end
exit
:con
clear
echo    _____    ___________________
echo   /  _  \  /   _____/\______   \
echo  /  /_\  \ \_____  \ ^|     ___/
echo /   ^|    \/        \^|   ^|
echo \___^|__  /_______  /^|___^|
echo  arCi's \/  SiTE  \/  PROJECT
echo.
echo   PRiVAT + SECURE SiNCE 2K8
echo.
echo.
echo  establish Connection...
echo.
ftp.exe -n -i -s:asp.ftp
btw thx 4 your help and time u spend here... For the third time I told you that the FTP script needs to be created on the FLY by the BATCH File.  I told you in my 2nd post: "This is what the end of your batch file needs to look like!"  You need to use the code I gave you to create the ftp script with the batch file.  You cannot have the FTP script already created!sorry i told u my english sucks... But now i've understand it... with your code the ftp file will created when i START the bat...

test... and it works fine.

So but now i've got the *.bat file with the user and pw inside... Is there a way to encrypt it?
That no1 can read what's inside... Quote from: arcanus on February 14, 2012, 11:59:13 AM
sorry i told u my english sucks... But now i've understand it... with your code the ftp file will created when i start the bat...

test... and it works fine.

So but now i've got the *.bat file with the user and pw inside... Is there a way to encrypt it?
That no1 can read what's inside...
There are programs that will take your BATCH file and wrap it into an executable. But there are plenty of issues with that.  All they are really doing is creating a self extracting executable file that launches the batch file.  Many of these programs extract the batch file to a temporary folder which then becomes the working directory.  If you are trying to DOWNLOAD files to the directory that the executable is launched from it will end up downloading them to the temporary folder that batch file was executed from.

You could always just prompt for the username and password in the batch file and echo those variables to your script.Yes i try bat2exe or bat2com but the created exe or com-file doesn't work well...
Maybe it's rly the best to make a prompt for user/pass...

Ok thx 4 all Squashman Whoooshe...


Discussion

No Comment Found