Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Auto-FTPing With A Batch File
ninjamunky
post May 29 2005, 01:04 PM
Post #1


Advanced Member
Group Icon

Group: Members
Posts: 129
Joined: 18-April 05
Member No.: 4,120



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.
Go to the top of the page
 
+Quote Post
dungsport
post May 31 2005, 06:41 AM
Post #2


Member - Active Contributor
Group Icon

Group: Members
Posts: 93
Joined: 21-March 05
Member No.: 3,136



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics


 



- Lo-Fi Version Time is now: 22nd August 2008 - 05:23 AM