Re: How do I pass parameters in a WSH file?




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


.



Relevant Pages

  • cl.exe need to compile myfile.c.lnk
    ... like to keep shortcuts (.lnk files) to each file in one directory. ... cl: Command line warning D4024: unrecognized source file type 'main.c.lnk', ... main.c.lnk: fatal error LNK1136: invalid or corrupt file ...
    (microsoft.public.vstudio.development)
  • Re: How do I pass parameters in a WSH file?
    ... Everytime I ever start using lnk files I abandon them. ... It would be elegent if WSH supported command line args. ... supporting them is a significant oversight - unless there's some particular ... > Create an ordinary *.lnk where you can append script arguments... ...
    (microsoft.public.scripting.wsh)
  • Re: all exe files switched to .lnk file type??
    ... to start Windows at all. ... Shortcuts actually have the extension .lnk - but this is usually hidden by ... It could be that the associations for .lnk files have been messed up. ... Search on Google for "lnk association". ...
    (microsoft.public.windowsxp.help_and_support)
  • 2003 installation changed all my files
    ... I bought and installed Office 2003 student and teacher. ... It installed all these .lnk files instead of my desktop ... shortcuts and changed all the icons I had there. ... The .lnk files don't work as shortcuts so I've lost ...
    (microsoft.public.office.setup)
  • Re: Create .lnk file for quick launch shortcut?
    ... copied them to quick launch and everything works great. ... why the shortcuts have ... left-clicked on but the keyboard commands quit working. ... Launch thinking the appropriate .lnk files would be created but the ...
    (microsoft.public.windowsxp.customize)