Run WSH Script from Applet
M. Gallant 06/07/2002
[Requires WSH 5.6 and CAPICOM 2 installed; signed for IE5 and NN 4+}
This signed applet demonstrates how to access a WSH script from a Java applet
using the following inter-process procedure:
- Instantiate Applet Panel
- Download a WSH script file from same codebase as the original applet using URL.openStream()
and save the url content (in this case, a script file) as a byte array in memory
- Write the script file to a temporary file _javasciencetempscript.vbs in the
current browser directory
- Use Process.exec(cscript _javasciencetempscript.vbs) to launch the script and collect
the stdio console output and display the results in a Java TextArea.
The WSH script downloaded by the applet and launched uses CAPICOM 2 functionality to
enumerate all CURRENT_USER certificate stores and displays some details for
certificates which contain private keys.
Java Applet Source Code
  WSH Script File