Re: Finding name of a file in a directory

Tech-Archive recommends: Speed Up your PC by fixing your registry




"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
>
>


.



Relevant Pages

  • Re: using xml to save/open project data
    ... http://www.TransProCalc.org - Free translation project mgmt software ... set filename tk_getOpenfile ... Exec'ing the script you run it as a separate process, your script won't be able to access its vars. ... generating the xml file is easy enough. ...
    (comp.lang.tcl)
  • Re: Finding name of a file in a directory
    ... I have a script which goes into a directory and finds out whether a file ... : empty or not. ... the filename will always have a datetime stamp ... without even the implied warranty of merchantability ...
    (microsoft.public.scripting.vbscript)
  • Re: Help me find 5 mistakes and than solution to thoes mistakes!
    ... > 8:# This script will create links to files from all of the filename ... > 10:# arguments provided on stdin if no filenames provided on command ...
    (Fedora)
  • Re: MIME - scripting and symbol substitutions
    ... This script is creating a text file with a different filename ... symbol called NEWFILENAME (which works, ... MIME from the command line with all options (so normal DCL ...
    (comp.os.vms)
  • Re: virtual server backups
    ... Here is the script. ... 'Save state the virtual machine ... Filename = MyArray) ... Set objVM = Nothing ...
    (microsoft.public.windows.server.general)