A Windows XP help forum. PCbanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » PCbanter forum » Microsoft Windows XP » General XP issues or comments
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

scheduling ftp



 
 
Thread Tools Display Modes
  #1  
Old December 8th 08, 03:42 PM posted to microsoft.public.windowsxp.general
Dektolia
external usenet poster
 
Posts: 3
Default scheduling ftp

Hi,

I found this article in the knowledge base and the steps it describes work
perfectly to create an ftp script which I can schedule to run daily in the
Scheduled Tasks.
http://support.microsoft.com/kb/96269

Unfortunately, the file I need to download has a different filename every
day. It always contains yesterdays date as part of the file name.

Is there a way to define a variable for yesterday's date, to prompt for the
filename, or to download all the files posted yesterday regardless of
filename? Anything not requiring user input would be preferred so it can
remain an automated task.

Thanks
Ads
  #2  
Old December 8th 08, 04:08 PM posted to microsoft.public.windowsxp.general
Pegasus \(MVP\)[_2678_]
external usenet poster
 
Posts: 1
Default scheduling ftp


"Dektolia" wrote in message
...
Hi,

I found this article in the knowledge base and the steps it describes work
perfectly to create an ftp script which I can schedule to run daily in the
Scheduled Tasks.
http://support.microsoft.com/kb/96269

Unfortunately, the file I need to download has a different filename every
day. It always contains yesterdays date as part of the file name.

Is there a way to define a variable for yesterday's date, to prompt for
the
filename, or to download all the files posted yesterday regardless of
filename? Anything not requiring user input would be preferred so it can
remain an automated task.

Thanks


The following .vbs script will return yesterday's date:
MyDate = DateAdd("d", date(), -1)
wscript.echo Year(MyDate) & pad(Month(MyDate)) & pad(Day(MyDate))
Function Pad (n)
Pad = right("0" & n, 2)
End Function
Unfortunately you left out several essential details, e.g.
- In what order is the date reflected in your file names?
- What delimiters (if any) are used between year, month and day?
- Are numbers below 10 shown with or without leading 0s?

Posting your ftp script might also be an excellent idea unless you're happy
to wrap it up yourself.


  #3  
Old December 8th 08, 04:51 PM posted to microsoft.public.windowsxp.general
Dektolia
external usenet poster
 
Posts: 3
Default scheduling ftp

Hi,

I used the knowledge base article to create an ftp script called test.scr
which works to transfer static filenames when I type 'ftp -s:test.scr' at a
command prompt (or, more imporantly, in windows scheduler). Unfortunately, in
the ftp script I'm limited to ftp commands and it ends up putting all
commands at an ftp prompt when I try to set variables. Is there a way to pass
the ftp script a variable so that I could use another executable to create
the variable filename and then call on the ftp script to use the variable
filename.

The date is in mmddyy format with leading zeros but no delimiters.

Here is the contents of the very simple ftp script (test.scr):

open ftpservername
user
password
lcd NewLocalDirectory
get File120708.txt.pgp
quit


"Pegasus (MVP)" wrote:


"Dektolia" wrote in message
...
Hi,

I found this article in the knowledge base and the steps it describes work
perfectly to create an ftp script which I can schedule to run daily in the
Scheduled Tasks.
http://support.microsoft.com/kb/96269

Unfortunately, the file I need to download has a different filename every
day. It always contains yesterdays date as part of the file name.

Is there a way to define a variable for yesterday's date, to prompt for
the
filename, or to download all the files posted yesterday regardless of
filename? Anything not requiring user input would be preferred so it can
remain an automated task.

Thanks


The following .vbs script will return yesterday's date:
MyDate = DateAdd("d", date(), -1)
wscript.echo Year(MyDate) & pad(Month(MyDate)) & pad(Day(MyDate))
Function Pad (n)
Pad = right("0" & n, 2)
End Function
Unfortunately you left out several essential details, e.g.
- In what order is the date reflected in your file names?
- What delimiters (if any) are used between year, month and day?
- Are numbers below 10 shown with or without leading 0s?

Posting your ftp script might also be an excellent idea unless you're happy
to wrap it up yourself.



  #4  
Old December 8th 08, 06:08 PM posted to microsoft.public.windowsxp.general
Dektolia
external usenet poster
 
Posts: 3
Default scheduling ftp

Due to the variable limitations with ftp it may be easier for me to copy all
the files to a temporary directory on my local machine (which I can do by
changing the get command below to mget *.txt.pgp) and then using another type
of script or batch file to move only the files with yesterday's date in the
name to the directory I want them to end up in. This removes the ftp portion
of the challenge. If there's an easier way to do it please let me know.

Thanks

"Dektolia" wrote:

Hi,

I used the knowledge base article to create an ftp script called test.scr
which works to transfer static filenames when I type 'ftp -s:test.scr' at a
command prompt (or, more imporantly, in windows scheduler). Unfortunately, in
the ftp script I'm limited to ftp commands and it ends up putting all
commands at an ftp prompt when I try to set variables. Is there a way to pass
the ftp script a variable so that I could use another executable to create
the variable filename and then call on the ftp script to use the variable
filename.

The date is in mmddyy format with leading zeros but no delimiters.

Here is the contents of the very simple ftp script (test.scr):

open ftpservername
user
password
lcd NewLocalDirectory
get File120708.txt.pgp
quit


"Pegasus (MVP)" wrote:


"Dektolia" wrote in message
...
Hi,

I found this article in the knowledge base and the steps it describes work
perfectly to create an ftp script which I can schedule to run daily in the
Scheduled Tasks.
http://support.microsoft.com/kb/96269

Unfortunately, the file I need to download has a different filename every
day. It always contains yesterdays date as part of the file name.

Is there a way to define a variable for yesterday's date, to prompt for
the
filename, or to download all the files posted yesterday regardless of
filename? Anything not requiring user input would be preferred so it can
remain an automated task.

Thanks


The following .vbs script will return yesterday's date:
MyDate = DateAdd("d", date(), -1)
wscript.echo Year(MyDate) & pad(Month(MyDate)) & pad(Day(MyDate))
Function Pad (n)
Pad = right("0" & n, 2)
End Function
Unfortunately you left out several essential details, e.g.
- In what order is the date reflected in your file names?
- What delimiters (if any) are used between year, month and day?
- Are numbers below 10 shown with or without leading 0s?

Posting your ftp script might also be an excellent idea unless you're happy
to wrap it up yourself.



  #5  
Old December 8th 08, 10:26 PM posted to microsoft.public.windowsxp.general
Pegasus \(MVP\)[_2680_]
external usenet poster
 
Posts: 1
Default scheduling ftp

The FTP command is sufficiently flexible to let you set or change just about
everything. Try this batch file:
@echo off
set site=ftp.dektolia.com
set user=dektolia
set password=SomePassword
set script=c:\script.scr
set VBS=c:\script.vbs

echo %VBS% MyD = DateAdd("d", date(), -1)
echo%VBS% wscript.echo p(Month(MyD)) ^& p(Day(MyD)) ^& p(Year(MyD))
echo%VBS% Function P(n)
echo%VBS% P = right("0" ^& n, 2)
echo%VBS% End Function
for /F %%a in ('cscript //nologo %VBS%') do set Yesterday=%%a
echo %script% %user%
echo%script% %password%
echo%script% binary
echo%script% get File%Yesterday%.txt.pgp
echo%script% quit

ftp -s:%Script% %site%
del %VBS%
del %script%
Change the first three "set" commands to reflect your environment. Do not
retype the batch file - use copy & paste instead.


"Dektolia" wrote in message
...
Hi,

I used the knowledge base article to create an ftp script called test.scr
which works to transfer static filenames when I type 'ftp -s:test.scr' at
a
command prompt (or, more imporantly, in windows scheduler). Unfortunately,
in
the ftp script I'm limited to ftp commands and it ends up putting all
commands at an ftp prompt when I try to set variables. Is there a way to
pass
the ftp script a variable so that I could use another executable to create
the variable filename and then call on the ftp script to use the variable
filename.

The date is in mmddyy format with leading zeros but no delimiters.

Here is the contents of the very simple ftp script (test.scr):

open ftpservername
user
password
lcd NewLocalDirectory
get File120708.txt.pgp
quit


"Pegasus (MVP)" wrote:


"Dektolia" wrote in message
...
Hi,

I found this article in the knowledge base and the steps it describes
work
perfectly to create an ftp script which I can schedule to run daily in
the
Scheduled Tasks.
http://support.microsoft.com/kb/96269

Unfortunately, the file I need to download has a different filename
every
day. It always contains yesterdays date as part of the file name.

Is there a way to define a variable for yesterday's date, to prompt for
the
filename, or to download all the files posted yesterday regardless of
filename? Anything not requiring user input would be preferred so it
can
remain an automated task.

Thanks


The following .vbs script will return yesterday's date:
MyDate = DateAdd("d", date(), -1)
wscript.echo Year(MyDate) & pad(Month(MyDate)) & pad(Day(MyDate))
Function Pad (n)
Pad = right("0" & n, 2)
End Function
Unfortunately you left out several essential details, e.g.
- In what order is the date reflected in your file names?
- What delimiters (if any) are used between year, month and day?
- Are numbers below 10 shown with or without leading 0s?

Posting your ftp script might also be an excellent idea unless you're
happy
to wrap it up yourself.





 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off






All times are GMT +1. The time now is 09:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 PCbanter.
The comments are property of their posters.