.BAT To use FTP and find first file in folder

July 1, 2009 at 08:12:06
Specs: Windows
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


See More: .BAT To use FTP and find first file in folder

Report •


#1
July 1, 2009 at 08:27:41
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


Report •

#2
July 1, 2009 at 08:36:48
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..


Report •

#3
July 1, 2009 at 09:00:29
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


Report •

Related Solutions

#4
July 1, 2009 at 09:22:27
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?


Report •

#5
July 1, 2009 at 09:32:56
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


Report •

#6
July 1, 2009 at 09:44:10
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.

Report •


Ask Question