10 pts.
 run vbscript on remote computer from java
How do I run vbscript on remote computer from java application?

Software/Hardware used:
ASKED: May 14, 2008  6:09 AM
UPDATED: May 14, 2008  8:26 AM

Answer Wiki:
Googling I found this (http://www.rgagnon.com/javadetails/java-0014.html) so I'd suppose that if you adjust the code below: ======== import java.io.*; public class CmdExec { public static void main(String argv[]) { try { String line; Process p = Runtime.getRuntime().exec (System.getenv("windir") +"\system32"+"tree.com /A"); BufferedReader input = new BufferedReader (new InputStreamReader(p.getInputStream())); while ((line = input.readLine()) != null) { System.out.println(line); } input.close(); } catch (Exception err) { err.printStackTrace(); } } } ======== By changing: Process p = Runtime.getRuntime().exec (System.getenv("windir") +"\system32"+"tree.com /A"); in Process p = Runtime.getRuntime().exec (System.getenv("windir") +"\system32"+"wscript.exe c:yourscript.vbs hosttocheck"); coule lead you to the solution. In the vbscript I suggest you to use command-line arguments in order to be able to pass the remote host's name/ip E.g. ' VbScript code Dim HostToCheck Set objArgs = WScript.Arguments If objArgs.Count > 0 Then HostToCheck = objArgs(0) End If .... I hope this helps
Last Wiki Answer Submitted:  May 14, 2008  8:26 am  by  alessandro.panzetta   9,695 pts.
All Answer Wiki Contributors:  alessandro.panzetta   9,695 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _