Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
.BAT To use FTP and find first file in folder
Name: logank9 Date: July 1, 2009 at 08:12:06 Pacific OS: Windows Subcategory: Batch
Comment:
I would like to create a .bat file that finds the first file in a folder on an FTP server.
FTP Server RandomFolder <- find the first file in this folder index.html ^Stuff on server
I know I have to use the FTP command, but I'm not sure how. It'd be great if someone could help me with this! :D
Name: Mechanix2Go Date: July 1, 2009 at 08:27:41 Pacific
Reply:
First you need to state exact OS, like the forum guide says.
And you need to define 'first'; by what criteria.
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 2
Name: logank9 Date: July 1, 2009 at 08:36:48 Pacific
Reply:
Alright, sorry about that.
My exact OS would be Linux on the FTP server, and I'm running Windows 7.
By first, I mean the oldest file created I guess..
0
Response Number 3
Name: Mechanix2Go Date: July 1, 2009 at 09:00:29 Pacific
Reply:
The listing I get is below. See what yours looks like. It's gonna be a bit messy. ========================= -rw-r--r-- 1 ftpuser ftpusers 49 Oct 19 2005 1696.TXT -rw-r--r-- 1 ftpuser ftpusers 816 Jan 9 2008 4.BAT -rw-r--r-- 1 ftpuser ftpusers 34020 Jun 18 2004 APcfg.txt
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 4
Name: logank9 Date: July 1, 2009 at 09:22:27 Pacific
Reply:
Sorry if this is a bit newbish ( it is ) but I have no clue what you are trying to say. This is my first time ever using FTP.
Where do I find the listing?
0
Response Number 5
Name: Mechanix2Go Date: July 1, 2009 at 09:32:56 Pacific
Reply:
Run this script and it will get list of files into a file om your PC called filelist.
============================== :: put in your own details
@echo off
> d.ftp echo o mysite.com >> d.ftp echo username >> d.ftp echo password >> d.ftp echo bin >> d.ftp echo ls -l filelist >> d.ftp echo bye
ftp -s:d.ftp
===================================== If at first you don't succeed, you're about average.
M2
0
Response Number 6
Name: logank9 Date: July 1, 2009 at 09:44:10 Pacific
Reply:
Ah, thank you for your help, but I think I may have found a solution to my problem already... I didn't need to do all of this.
Summary: can someone post a link or code for c++ on linux for assigning the first file in a directory to a variable? i'm not a programmer but have cobbled together a number of things (with lots of help from fo...
Summary: Hi Thanks for your reply..But somehow I was not able to use the code because it was throwing me error saying system could not find the specified file.. came up with the following code which is working...
Summary: Hi, I have learned lots through reading this site (usually find it via google). It's encouraged me to set up and account and pose some more questions, and hopefully answer some as time goes by... Belo...