Hi;

I have had a continuous problem with webserver log files for quite some time
and I've spent a ton of time trying different methods to solve the issue -
with zero success.

What I need is a short script that;

FTP's into my site and downloads my log file
Writes it to a directory on my hard drive with Today's Date
Then opens a web browser to an address of my choosing.
And finally - closes off.

I believe I can use the native FTP built-into Windows 2000 and automate the
script's execution with Task Scheduler. I'm just completely useless with
programming.

Can anyone help?

Thanks;
Marvin Miller

Re: Can Someone Write a Short Script for Me? by Marvin

Marvin
Sat Aug 20 21:46:21 CDT 2005

I found this on the Internet. It seems to be almost perfect except that it
expects the source file date to be varied whereas mine is static. If that
feature could be implemented when it writes to disk (writes the proper date)
then it would be near perfect.
----------------------------------------------------------------------------
-------------------------------------------------
Many of us work in a heterogeneous technical environment. Our environment
may require us to get files from *nix servers or mainframe. The following
example demonstrate a technique to get a file via FTP, assuming the file you
want to get daily is named as YYYYMMDDData.csv. Because the file name
changes daily, so we generate FTP script files on the fly. The rest of the
code should be self-explanatory.
Option Explicit
Dim objFSO, objMyFile, objShell, strFTPScriptFileName, strFile2Get
Dim strLocalFolderName, strFTPServerName, strLoginID
Dim strPassword, strFTPServerFolder

'Customize code here to fit your needs
strLocalFolderName = "My Folder Name where we put the file to be FTPed"
strFTPServerName = "FTP Server Name"
strLoginID = "FTP Server Login ID"
strPassword = "FTP Login ID Password"
strFTPServerFolder = "Folder Name on FTP server where the file resides"

'The following code converts date to the right format, YYYYMMDD
strFile2Get = DatePart("yyyy",Date)

If DatePart("m",Date) < 10 Then
strFile2Get = strFile2Get & "0"
End If

strFile2Get = strFile2Get & DatePart("m",Date)

If DatePart("d",Date) < 10 Then
strFile2Get = strFile2Get & "0"
End If

strFile2Get = strFile2Get & DatePart("d",Date)

'The following code generates the file name on the FTP server you want to
get
strFile2Get = "Data" & strFile2Get & ".csv"

'The follow lines of code generate the FTP script file on the fly,
'because the get file name changes every day

strFTPScriptFileName = strLocalFolderName & "\FTPScript.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")

If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If

Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("ascii")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("get " & strFile2Get)
objMyFile.WriteLine ("bye")
objMyFile.Close
Set objFSO = Nothing
Set objMyFile = Nothing

'The following code executes the FTP script. It creates a Shell
'object and run FTP program on top of it.
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))
Set objShell = Nothing"Marvin Miller" <someone@microsoft.com> wrote in
message news:ujwPLOfpFHA.2472@tk2msftngp13.phx.gbl...
> Hi;
>
> I have had a continuous problem with webserver log files for quite some
time
> and I've spent a ton of time trying different methods to solve the issue -
> with zero success.
>
> What I need is a short script that;
>
> FTP's into my site and downloads my log file
> Writes it to a directory on my hard drive with Today's Date
> Then opens a web browser to an address of my choosing.
> And finally - closes off.
>
> I believe I can use the native FTP built-into Windows 2000 and automate
the
> script's execution with Task Scheduler. I'm just completely useless with
> programming.
>
> Can anyone help?
>
> Thanks;
> Marvin Miller
>
>



Re: Can Someone Write a Short Script for Me? by Don

Don
Sun Aug 21 16:17:29 CDT 2005

try a automated ftp client like http://www.ftpvoyager.com/
They are cheap (might even find a free one if you search enough) and they
should do everything you asked for.



--
Hope it helps

dw

_______________________________
Don Wilwol
donwilwol(DELETE)@yahoo.com
http://spaces.msn.com/members/wilwol/


"Marvin Miller" <someone@microsoft.com> wrote in message
news:ujwPLOfpFHA.2472@tk2msftngp13.phx.gbl...
> Hi;
>
> I have had a continuous problem with webserver log files for quite some
> time
> and I've spent a ton of time trying different methods to solve the issue -
> with zero success.
>
> What I need is a short script that;
>
> FTP's into my site and downloads my log file
> Writes it to a directory on my hard drive with Today's Date
> Then opens a web browser to an address of my choosing.
> And finally - closes off.
>
> I believe I can use the native FTP built-into Windows 2000 and automate
> the
> script's execution with Task Scheduler. I'm just completely useless with
> programming.
>
> Can anyone help?
>
> Thanks;
> Marvin Miller
>
>



Re: Can Someone Write a Short Script for Me? by Marvin

Marvin
Sun Aug 21 22:37:21 CDT 2005

I looked into free ones but the one you listed is has an annual recurring
fee and with so many software companies today looking for that recurring
revenue stream - my wallet is getting thin :-)

The code I posted looks like it should be relatively easy to modify seeing
it's already written to retrieve via ftp. For scheduling I can use the
native scheduler service. I've now got the code for accessing the website
(in vbscript) so it's just a matter of finding someone to re-arrange the
existing code for me :-)

Thanks;
Marvin



"Don Wilwol" <donWilwol@(EMAIL)yahoo.com> wrote in message
news:OS7dDXppFHA.2580@TK2MSFTNGP09.phx.gbl...
> try a automated ftp client like http://www.ftpvoyager.com/
> They are cheap (might even find a free one if you search enough) and they
> should do everything you asked for.
>
>
>
> --
> Hope it helps
>
> dw
>
> _______________________________
> Don Wilwol
> donwilwol(DELETE)@yahoo.com
> http://spaces.msn.com/members/wilwol/
>
>
> "Marvin Miller" <someone@microsoft.com> wrote in message
> news:ujwPLOfpFHA.2472@tk2msftngp13.phx.gbl...
> > Hi;
> >
> > I have had a continuous problem with webserver log files for quite some
> > time
> > and I've spent a ton of time trying different methods to solve the
issue -
> > with zero success.
> >
> > What I need is a short script that;
> >
> > FTP's into my site and downloads my log file
> > Writes it to a directory on my hard drive with Today's Date
> > Then opens a web browser to an address of my choosing.
> > And finally - closes off.
> >
> > I believe I can use the native FTP built-into Windows 2000 and automate
> > the
> > script's execution with Task Scheduler. I'm just completely useless with
> > programming.
> >
> > Can anyone help?
> >
> > Thanks;
> > Marvin Miller
> >
> >
>
>