I am trying to parse the command echo msg>com4
to CMD from web application. I was tried different ways but I am not able to do it. In this case I want to show the results also without popping CMD run and close it.
Here is my script:
<html>
<head>
<script language="vbscript" type="text/Vbscript">
Function cmdRun( )
Dim shell, fileName
Set shell = CreateObject("WScript.Shell")
Set proc = shell.Exec("echo msg>com4")
End Function
</script>
</head>
<body>
<input type="button" onclick="cmdRun()" value="copy" />
</body>
</html>
Sometimes it is showing error "VBA Script 424: object required". When I used cscript that also shows the error.