PC Review


Reply
Thread Tools Rate Thread

cmd file for FTP commands?

 
 
James
Guest
Posts: n/a
 
      10th Nov 2008
I was wanting to setup a cmd or bat file to connect to a remote server and move whatever folders are there from the remote system to my system. I want to be able to use windows task manager to schedule it every morning at a certain time. Since the folder names are going to change, I cannot put a specific folder name on it. Is a cmd or bat file the best way to go or is there an easier way of doing it?

Thanks in advance,
James B.
 
Reply With Quote
 
 
 
 
Klaus Jorgensen
Guest
Posts: n/a
 
      10th Nov 2008
James wrote on 10-11-2008 :
> I was wanting to setup a cmd or bat file to connect to a remote server and
> move whatever folders are there from the remote system to my system. I want
> to be able to use windows task manager to schedule it every morning at a
> certain time. Since the folder names are going to change, I cannot put a
> specific folder name on it. Is a cmd or bat file the best way to go or is
> there an easier way of doing it?


If the folder names changes from one day to another, how would a script
be able to distinguish them from the rest - that is, if other folders
should not be copied?
Please be more specific - or give an example.

--
/klaus


 
Reply With Quote
 
James
Guest
Posts: n/a
 
      10th Nov 2008
Ok could I copy all of the folders then delete them from the remote server?
The end result is to "move" (or copy and delete) the folders that are being
put there every morning and get them to my system. The folder are an export
for another program for a differnent company we do business with.


"Klaus Jorgensen" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> James wrote on 10-11-2008 :
>> I was wanting to setup a cmd or bat file to connect to a remote server
>> and move whatever folders are there from the remote system to my system.
>> I want to be able to use windows task manager to schedule it every
>> morning at a certain time. Since the folder names are going to change, I
>> cannot put a specific folder name on it. Is a cmd or bat file the best
>> way to go or is there an easier way of doing it?

>
> If the folder names changes from one day to another, how would a script be
> able to distinguish them from the rest - that is, if other folders should
> not be copied?
> Please be more specific - or give an example.
>
> --
> /klaus
>
>



 
Reply With Quote
 
Klaus Jorgensen
Guest
Posts: n/a
 
      11th Nov 2008
James expressed precisely :
> Ok could I copy all of the folders then delete them from the remote server?
> The end result is to "move" (or copy and delete) the folders that are being
> put there every morning and get them to my system. The folder are an export
> for another program for a differnent company we do business with.


The FTP client in Windows XP copies files from one folder at a time,
there is no xcopy funtion.
I think your best option would be a zipped file created on the remote
system with all the files/folders in it, meaning one file only to copy.
The file name of the zipped file could be created from the system date.
An ftp script for this would be very simple.

--
/klaus


 
Reply With Quote
 
Rick Merrill
Guest
Posts: n/a
 
      12th Nov 2008
Klaus Jorgensen wrote:
> James expressed precisely :
>> Ok could I copy all of the folders then delete them from the remote
>> server? The end result is to "move" (or copy and delete) the folders
>> that are being put there every morning and get them to my system. The
>> folder are an export for another program for a differnent company we
>> do business with.

>
> The FTP client in Windows XP copies files from one folder at a time,
> there is no xcopy funtion.
> I think your best option would be a zipped file created on the remote
> system with all the files/folders in it, meaning one file only to copy.
> The file name of the zipped file could be created from the system date.
> An ftp script for this would be very simple.
>


Suppose the folders are named with a datestamp - the OP could have a
small program that would anticipate the datestamp and poop out a batch
file for the FTP program. The latter would always have the same name so
the program would be run automaticly as a scheduled task.

So you wind up scheduling 2 program to run in staggered fashion: one
creates the file for the other.
 
Reply With Quote
 
James
Guest
Posts: n/a
 
      14th Nov 2008
can you recommend any third party software that will do what I want? It
seems as if I'm making Microsoft do more than it's made to do



"Rick Merrill" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Klaus Jorgensen wrote:
>> James expressed precisely :
>>> Ok could I copy all of the folders then delete them from the remote
>>> server? The end result is to "move" (or copy and delete) the folders
>>> that are being put there every morning and get them to my system. The
>>> folder are an export for another program for a differnent company we do
>>> business with.

>>
>> The FTP client in Windows XP copies files from one folder at a time,
>> there is no xcopy funtion.
>> I think your best option would be a zipped file created on the remote
>> system with all the files/folders in it, meaning one file only to copy.
>> The file name of the zipped file could be created from the system date.
>> An ftp script for this would be very simple.
>>

>
> Suppose the folders are named with a datestamp - the OP could have a small
> program that would anticipate the datestamp and poop out a batch file for
> the FTP program. The latter would always have the same name so the
> program would be run automaticly as a scheduled task.
>
> So you wind up scheduling 2 program to run in staggered fashion: one
> creates the file for the other.



 
Reply With Quote
 
Klaus Jorgensen
Guest
Posts: n/a
 
      14th Nov 2008
James presented the following explanation :
>It seems as if I'm making Microsoft do more than it's made to do


Not at all - I did something similar a couple of years back.
Using the datestamp as part of the zipped file is optional - use it if
you need some sort of historical data (and if there are no problems
with disk quota/space at both systems).
See if the examples below makes any sense.
(In batch scripts, I'm always using variables to define file locations
- it makes things easier if they to be changed later on.)


---At the remote end, a bat file could look like this:
set zippgm="%PROGRAMFILES%\WinZip\WinZip32.exe"
set zipfname="C:\ftproot\james\DataFiles%DATE:~0,2%.zip"
set datfiles="C:\DataFiles\*.*"
%zippgm% -a -p -r %zipfname% %datfiles%

---At your end:
set ftpcmd=C:\DataFiles\getdata.ftp
set zipfname=DataFiles%DATE:~0,2%.zip
echo ftp.remotesite.com >%ftpcmd%
echo username >>%ftpcmd%
echo password >>%ftpcmd%
echo bin >>%ftpcmd%
echo cd james >>%ftpcmd%
echo get %zipfname% >>%ftpcmd%
echo bye >>%ftpcmd%
ftp -s:%ftpcmd%

--
/klaus


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
file commands =?Utf-8?B?bWFyaw==?= Microsoft Excel Worksheet Functions 1 8th Oct 2005 02:47 PM
Convert 'Open Report' commands to 'Output to' commands Leslie Isaacs Microsoft Access Macros 9 7th Mar 2005 06:03 PM
Convert 'Open Report' commands to 'Output to' commands Leslie Isaacs Microsoft Access VBA Modules 9 7th Mar 2005 06:03 PM
FTP commands from batch file Michael Lawson Microsoft Windows 2000 1 13th Aug 2004 01:31 AM
Trying to get muiltple commands to run in bat file Darrell Microsoft Windows 2000 CMD Promt 2 3rd Dec 2003 04:39 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:45 PM.