Re: Finding name of a file in a directory
- From: "Al Dunbar [MS-MVP]" <alan-no-drub-spam@xxxxxxxxxxx>
- Date: Wed, 8 Jun 2005 22:18:50 -0600
"Roland Hall" <nobody@nowhere> wrote in message
news:%23cFcGaHbFHA.3328@xxxxxxxxxxxxxxxxxxxxxxx
> "Jig Bhakta" wrote in message
> news:A3BC8A8D-BDCA-4602-941C-2B21AF14F7EF@xxxxxxxxxxxxxxxx
>
> : I have a script which goes into a directory and finds out whether a file
> is
> : empty or not. The only problem is that I have to currently hardcode the
> : filename. However, the filename will always have a datetime stamp
> : (NV060705-143400.txt - only NV will remain the same) on it and will
> change
> : everyday. Can someone help me figure out how I can get this filename
and
> : store it in a variable so that I can then checks its filesize?
>
> dim file
> file = "NV060705-143400.txt"
>
> Now, it's a variable. However, you probably mean how can you pass the
> filename as a variable to your script? Is this a VBS script or ASP? I
ask
> because they work differently.
>
> Is there ever more than one file in a given day?
>
> Ex. NV060705-143401.txt, NV060705-143402.txt
>
> If there is only one file per day, and it's always the current day, and
> assuming your filename date pattern is mmddyy, and it's always in the same
> folder, then you can retrieve it without passing the name.
Another option could be to open Windows explorer, find the file yourself,
then drag-n-drop it onto the .vbs script.
/Al
> Please provide answers to the questions I posed and something can be
worked
> out.
>
> --
> Roland Hall
> /* This information is distributed in the hope that it will be useful, but
> without any warranty; without even the implied warranty of merchantability
> or fitness for a particular purpose. */
> Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
> WSH 5.6 Documentation -
http://msdn.microsoft.com/downloads/list/webdev.asp
> MSDN Library - http://msdn.microsoft.com/library/default.asp
>
>
.
- Follow-Ups:
- Re: Finding name of a file in a directory
- From: Roland Hall
- Re: Finding name of a file in a directory
- References:
- Finding name of a file in a directory
- From: Jig Bhakta
- Re: Finding name of a file in a directory
- From: Roland Hall
- Finding name of a file in a directory
- Prev by Date: Re: Equivalent to VBAs Open Dialog Filename
- Next by Date: Re: How do I parse this string and pick the second column only
- Previous by thread: Re: Finding name of a file in a directory
- Next by thread: Re: Finding name of a file in a directory
- Index(es):
Relevant Pages
|