Re: Finding name of a file in a directory




"Wayne Simacek" <WJSimacek@xxxxxxxxx> wrote in message
news:La7qe.42217$nG6.9008@xxxxxxxxxxxx
>
> "Al Dunbar [MS-MVP]" <alan-no-drub-spam@xxxxxxxxxxx> wrote in message
> news:elIx4yUbFHA.2184@xxxxxxxxxxxxxxxxxxxxxxx
> >
> > "Roland Hall" <nobody@nowhere> wrote in message
> > news:OBIiDiMbFHA.2900@xxxxxxxxxxxxxxxxxxxxxxx
> >> "Al Dunbar [MS-MVP]" wrote in message
> >> news:un0PZpKbFHA.3932@xxxxxxxxxxxxxxxxxxxxxxx
> >> :
> >> : > "Jig Bhakta" wrote in message
> >> : > news:A3BC8A8D-BDCA-4602-941C-2B21AF14F7EF@xxxxxxxxxxxxxxxx

<snip>

> > Oops. It only does that if the script does that, and if the script
accepts
> > the pathname of the file in question as a command line parameter.
> >
> > /Al
> >
> >
> This is a very interesting thread....
> How do you drag a file onto a .vbs script and pass it the paramaters?

Same way you drag a file (or even a set of files) onto a batch script - or a
shortcut to a script:

- click and hold the file to be dragged with the mouse
- drag it over onto the script
- let go of the button.

Passing the file to the script is easy, but there needs to be code in the
script that receives the information. In batch scripts it is %1, %2, and
etc. For vbscript, try this code for starters:

Set objArgs = WScript.Arguments
For I = 0 to objArgs.Count - 1
WScript.Echo objArgs(I)
Next

/Al


.


Loading