I want to run an executable from a .vbs login script that starts up our
virusscanner installation/update.

What is the correct syntax to run an executable from this script?

Thx.

Re: starting executable in login script by Lucien

Lucien
Tue Jul 29 04:36:42 CDT 2003

"Richard Mueller [MVP]" <rlmueller@ameritech.net> schreef in bericht
news:uLnxbfSVDHA.532@TK2MSFTNGP09.phx.gbl...
> Lucien Thierry wrote:
>
> > I want to run an executable from a .vbs login script that starts up our
> > virusscanner installation/update.
> >
> > What is the correct syntax to run an executable from this script?
>
> Hi,
>
> You can use the Run method of the WshShell object. The program will run
with
> the permissions of the user.
>
> Set objShell = CreateObject("Wscript.Shell")
> objShell.Run("%COMSPEC% /c avscanner.exe", 0)
>
> Check the WSH documentation for the Run method. The second parameter
> indicates how the command is to be run, 0 means hidden, 1 normal
(default),
> 2 minimized, 3 maximized.
>
> --
> Richard
> Microsoft MVP Scripting and ADSI
> HilltopLab web site - http://www.rlmueller.net
> --
>
>
Hi Richard,

Thank U for your help, but... when I used your method I got an error
stating: Can not use quotation marks while invoking sub-value. Instead I
used this method:

Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")

Set oExec = WshShell.Exec(\\server\avscanner.exe)

Could U tell me the difference between the two?

Thx.



Re: starting executable in login script by Richard

Richard
Tue Jul 29 11:30:14 CDT 2003


"Lucien Thierry" <lucien.thierry@lycos.nl> wrote in message
news:#aO$sTbVDHA.2568@tk2msftngp13.phx.gbl...
> "Richard Mueller [MVP]" <rlmueller@ameritech.net> schreef in bericht
> news:uLnxbfSVDHA.532@TK2MSFTNGP09.phx.gbl...
> > Lucien Thierry wrote:
> >
> > > I want to run an executable from a .vbs login script that starts up
our
> > > virusscanner installation/update.
> > >
> > > What is the correct syntax to run an executable from this script?
> >
> > Hi,
> >
> > You can use the Run method of the WshShell object. The program will run
> with
> > the permissions of the user.
> >
> > Set objShell = CreateObject("Wscript.Shell")
> > objShell.Run("%COMSPEC% /c avscanner.exe", 0)
> >
> > Check the WSH documentation for the Run method. The second parameter
> > indicates how the command is to be run, 0 means hidden, 1 normal
> (default),
> > 2 minimized, 3 maximized.
> >
> > --
> > Richard
> > Microsoft MVP Scripting and ADSI
> > HilltopLab web site - http://www.rlmueller.net
> > --
> >
> >
> Hi Richard,
>
> Thank U for your help, but... when I used your method I got an error
> stating: Can not use quotation marks while invoking sub-value. Instead I
> used this method:
>
> Dim WshShell, oExec
> Set WshShell = CreateObject("WScript.Shell")
>
> Set oExec = WshShell.Exec(\\server\avscanner.exe)
>
> Could U tell me the difference between the two?
>
> Thx.
>
>
I can't explain your error message about quotation marks. The main
difference with WshShell.Exec is that it requires WSH 5.6. However, it
returns an object that provides access to status and error information, and
StdIn, StdOut, and StdErr.

--
Richard
Microsoft MVP Scripting and ADSI
HilltopLab web site - http://www.rlmueller.net
--