I know only enough VBscript to be dangerous.
I am trying to pass a variable parameter from a form
to a program invoked from WScript.Shell.
For the purpose of the example let us suppose that i
am trying to pass a file name to NOTEPAD.
How do I do it? Here is what I have so far:
Any help much appreciated!
Clive
I am trying to pass a variable parameter from a form
to a program invoked from WScript.Shell.
For the purpose of the example let us suppose that i
am trying to pass a file name to NOTEPAD.
How do I do it? Here is what I have so far:
Code:
<html><head><title>Test</title>
<!--
***************************************************
**** This javascript subroutine is called when
**** the form's "Certify" button is clicked. It
**** calls the VBscript routine Launch() and then
**** closes the browser window
***************************************************
-->
<script type="text/javascript">
function process(data) {
launch(data)
timer=setTimeout('self.close()',1000)
}
</script>
<!--
***************************************************
**** launch
**** This VBscript subroutine will call
**** program NOTEPAD.EXE
***************************************************
-->
<script type="text/vbscript">
sub launch(parm1)
Dim MyObj
Set MyObj=CreateObject("WScript.Shell")
MyObj.Run "NOTEPAD.EXE parm1"
end sub
</script>
</head>
<!--
***************************************************
***** This is the HTML for the Cerification form
***************************************************
-->
<body style="background:beige">
<h2>Master Certification</h2>
ENTER Candidate's Name:<br />
<form name="formC">
<input name="candidate" type="text" size="40" />
<br /><br />
<input type="button" value="Certify"
onclick="process(document.formC.candidate.value)" />
</form>
<script type="text/javascript">
document.formC.candidate.focus()
</script>
</body></html>
Any help much appreciated!
Clive