Re: How do I pass parameters in a WSH file?
- From: "Al Dunbar [MS-MVP]" <alan-no-drub-spam@xxxxxxxxxxx>
- Date: Sun, 26 Jun 2005 21:43:31 -0600
"bruce cartland" <bruce.cartland.REMOVE@xxxxxxxxxxx> wrote in message
news:2A067B17-1923-4AF3-9CA4-8FA879FABCF7@xxxxxxxxxxxxxxxx
> hmm! lnk files are almost useless (why oh why can't we have UNIX style
file
> links - though maybe file forks can do the same but nothing supports
those).
> Everytime I ever start using lnk files I abandon them. You can't have
> relative paths and you invalidated them when you copy them somewhere else.
Yeah, I'd like to see relative targets in .lnk files to, but... would it be
more logical to assume the paths are relative to where the .lnk file is
located, or to the current directory?
I'd also like to see shortcuts to shortcuts allowed, however that would
allow you to set up a circular shortcut sequence that would never resolve
itself.
> I want to set up a set of "standard arg" files for various operations that
> use the same core script. At the moment I do an EXEC from other vbs files.
> This means you get flashing DOS boxes. It's workable but clumsy.
You could keep these boxes them from appearing by using .run instead of EXEC
and setting the windowstyle appropriately.
> It would be elegent if WSH supported command line args. Seems to me not
> supporting them is a significant oversight - unless there's some
particular
> reason for it.
I generally avoid having this issue by using command line arguments very
sparingly.
> [You reckon it would be feasible to write my own WSH engine?]
You could certainly make up for some of the shortcomings as you see them by
writing your own class to provide standard commandline argument parsing...
/Al
> "Michael Harris (MVP)" wrote:
>
> > bruce cartland wrote:
> > > ie. something like
> > >
> > > [ScriptFile]
> > > Path=.\sample.wsf /myarg:mystr
> >
> > You can't since the syntax above isn't supported and there is no support
for
> > any Args or Arguments variable in a WSH file.
> >
> > > [Options]
> > > Timeout=0
> > > DisplayLogo=0
> > > BatchMode=0
> >
> >
> > Create an ordinary *.lnk where you can append script arguments...
> >
> > If you want to be explicit about the host switches:
> >
> > //T:0 is the same as TimeOut=0
> > //T:n is the same as TimeOut=n
> > //NoLogo is the same as DisplayLogo=0
> > absence of //NoLogo is the same as DisplayLogo=1
> > //I is the same BatchMode=0
> > //B is the same BatchMode=1
> >
> >
> >
> > --
> > Michael Harris
> > Microsoft MVP Scripting
> >
> >
> >
> >
> >
.
- References:
- How do I pass parameters in a WSH file?
- From: bruce cartland
- Re: How do I pass parameters in a WSH file?
- From: Michael Harris \(MVP\)
- Re: How do I pass parameters in a WSH file?
- From: bruce cartland
- How do I pass parameters in a WSH file?
- Prev by Date: Re: Accessing WScript.Arguments.Named duplicate arguments
- Next by Date: Did WSH.NET or "Script for .NET" go anywhere?
- Previous by thread: Re: How do I pass parameters in a WSH file?
- Next by thread: Batch File/Script to Recursively Delete Files and Folders in Subdirectories
- Index(es):
Relevant Pages
|