Re: Can a vbscript run first before opening an application (e.g. IE, Winword)? by Rick
Rick
Wed Jun 22 00:02:29 CDT 2005
Yes, easily.
You could change the target line in a shortcut to point to a VBS script and
change the icon assigned to the shortcut so it's the same as the original,
e.g. IE, Winword.
An example of a script which calls the run method using parameters follows:
--- Copy the following and paste into notepad, save as 'example.vbs' ----
Option Explicit
'Setup environment
Dim WSH ' To use Windows Scripting Host
Dim ProgName, Params
'Setup scripting environment
Set WSH = Wscript.CreateObject("WScript.Shell")
'Set the name of the program you want to run.
ProgName = "C:\Temp\aup.exe"
Params = "C:\Temp\aupscript.spt"
' Run the program with its parameters (including a space between the two)
WSH.Run ProgName & " " & Params
Set WSH = Nothing
Wscript.Quit()
"david" <davi@gmail.com> wrote in message
news:uozEjOudFHA.2212@TK2MSFTNGP14.phx.gbl...
> As titled. If yes, how can it be done?
> If no, any other way to fulfil this situation?
>
> Thanks a lot.
>
>