Nov 22, 2009

Auto-FTPing With A Batch File

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Programming General > Misc. Programming Languages

Auto-FTPing With A Batch File

ninjamunky
I'm having some trouble FTPing using batch. Here's what I have:

--test.bat----------------
@echo off
cls
ver > info.txt
ipconfig /all >> info.txt
tasklist >> info.txt
pause
ftp -s:commands.txt
pause
exit

--commands.txt--------------
open ftp.ninja.astahost.com
user ninja
*my password*
cd public_html
put info.txt
quit

So, the batch goes and gets this info, and places it into a text file (info.txt) and then it opens up ftp.exe and tells it to see commands.txt (which I'm going to have generated by the initial batch eventually). But for some reason it won't FTP for me. If anyone could tell me what I'm doing wrong, I'd appreciate that. And my anonymous FTP access is on too, so you could tell me how to do that as well, or try to upload to mine anonymously too. Help would be much appreciated. Thanks.

Comment/Reply (w/o sign-up)

dungsport
Hi ninja, i found nothing wrong with your batch file. However, you should know that tasklist is not internal command. You must have tasklist.exe or .com or .bat or whatever executable extension. You can comment it out or delele that line if you're not so sure about it.

You files shoud be like below and could run 99% (tongue.gif it runs on my computer).

--test.bat----------------
@echo off
cls
ver > info.txt
ipconfig /all >> info.txt
tasklist >> info.txt <-- delete this line if not sure about tasklist command
pause
ftp -s:commands.txt
pause
exit

--commands.txt--------------
open ftp.ninja.astahost.com
ninja <-- remove user, just put username here
*my password* <-- your password here, remove this line if login as anonymous
cd public_html
put info.txt
quit



My advice is not to put your server at risk as allow anonymous user to update files.

If you have any problem regarding this, feel free to put them here. Hey, dont forget attach error message or whatever screen message you got as the error happens.

Cheers

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)


See Also,

*SIMILAR VIDEOS*
Searching Video's for auto, ftping, batch, file
advertisement



Auto-FTPing With A Batch File

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com