ASP - passing parameters to a program from a web page

Asked By Solomon Appah on 03-Dec-01 08:21 AM
Please can you tell me how i can run an executable program from an html
> page. The file resides on the clients machine and resides in a particular
> directory say c:pwhc\apps\care.exe. i have a link to this file but the
> problem is that the care.exe requires some command line parameters before
it
> can run.  Can you tell me how i can use the .vbs file to gather parameters
> from the web page and run the file with the Run method. I want to pass the
> parameter from the web page via a hyperlink to the .vbs file and in it
read
> the parameters from the web and run the file for me.

EXample: - Asked By Peter Bromberg on 03-Dec-01 08:35 AM

The process of running a local file:
' Now we'll "run" the file....
Dim WshShell
Set WshShell =CreateObject("WScript.Shell")
WshShell.Run ("c:\temp\notepad.exe")
Set WsShell = Nothing

Passing parameters requires Windows Script version 5.6 or higher. The process for this is:

param1= WScript.Arguments.Named.Item("param1")
param2= WScript.Arguments.Named.Item("param2")
'' local page:
param1 = request.querystring("param1")
param2 = Request.querystring("param2")
' or the above could be formfield values or
' local page variables

WshShell.Run( 'c:\pwhc\apps\care.exe /param1:" & param1 & " /param2:" & param2 & ')

set WshShell = Nothing

passing parameters to a program from a web page - Asked By Solomon Appah on 20-Jul-14 01:58 PM

I am currently using version 5.1 and the WScript.Arguments.Named.Item("param1")
is not recognised. So i will now download version 5.6 and try it again and get back to you.

passing parameters to a program from a web page - Asked By Solomon Appah on 20-Jul-14 01:59 PM

I meant passing the parameter from an html hyper as in "<a href="c:\care.vbs?param1:value">care.vbs</a>"
Arguments collection - Asked By Peter Bromberg on 03-Dec-01 09:45 AM
Read up on the Arguments.Named.Item and Arguments.Unnamed.Items collections. You'll be able to do it.