Pass Parameter To A Program Through Html Link
Solution 1:
I see only one solution, use .BAT file, where will be "netstat.exe -a", named for example netstat-a.bat.
<ahref="C:\Windows\System32\NETSTAT-A.BAT">CLICK</a>
It's quite impertect solution, but can works :)
You can also try this code, but it depend of browser and user rights:
<html><head><scriptlanguage="JavaScript"type="text/javascript">MyObject = newActiveXObject( "WScript.Shell" )
functionRunNotePad()
{
MyObject.Run("netstat.exe -a") ;
}
</script></head><body><h1>Run a Program</h1>
This script launch the file >> c:\windows\notepad.exe<p><buttononclick="RunNotePad()">Run Windows NotePad</button></body></html>
Solution 2:
As from my point of view as
<A>
is case sensitive it will treat C:\Windows\System32\NETSTAT.EXE -a
as whole path rather than -a
as an argument.
Above link is working as it also take as an argument and it is there inside system32 that why it execute
Similarly it a treat <a href="C:\Windows\System32\NETSTAT.EXE -a">CLICK</a>
as a whole file which is not there so there is only one method to solve the problem make it as .bat the whole path and save it and give the path in and save netstat-a.bat or whatever you want in <a>
and give that whole path in <a>C:\Windows\System32\NETSTAT.EXE-a.bat</a>
Post a Comment for "Pass Parameter To A Program Through Html Link"