Remote Shell call - InfoPath Dev
in

InfoPath Dev

Remote Shell call

Last post 04-18-2005 12:54 PM by Shanthi Reddy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-11-2005 05:28 AM

    • Lee
    • Not Ranked
    • Joined on 07-23-2004
    • United Kingdom
    • Posts 18

    Remote Shell call

    Hi,

    I have been searching for a while now on how to make remote shell calls from JScript.

    For the form i am creating at the moment i have an inhouse system that i need to obtain information from, the problem is the only way in is by using a remote shell call.

    Does anyone know how to do this in JScript.

    Regards

    Lee

    Lee A Newson
  • 04-11-2005 08:29 AM In reply to

    • Lee
    • Not Ranked
    • Joined on 07-23-2004
    • United Kingdom
    • Posts 18
    OK, so i have managed to figure out how to run the script and command i need, however now i have a bigger problem and i am really stuck on this.

    the code i used to run the script was this:

    var Shell = new ActiveXObject("WScript.shell");
    var strCMD = "rsh machine name -l username java -cp c:\\jdk1.3\\bin GenXMLT \"where bug_id = " + eventObj.NewValue + "\"";
    Shell.Run(strCMD);

    when this is run a line is returned and displayed in the command window... how can i get that line and put it in the form???

    i tried copying the function into Visual Studio so that i could see all the properties etc of "Shell", but there doesn't seem to be anything that can read the returned data.

    Cheers for any help

    Lee


    Lee A Newson
  • 04-12-2005 07:44 AM In reply to

    • Lee
    • Not Ranked
    • Joined on 07-23-2004
    • United Kingdom
    • Posts 18
    OK, i have finally managed to find out how to do this...

    var Shell = new ActiveXObject("WScript.shell");
    var strCMD = "put your command here";

    var oExec = Shell.Exec(strCMD);
    var oExecOut = oExec.StdOut;

    var input = "";
    input = oExecOut.ReadAll();

    in the end it turned out to be quite simple... i just didn't understand WScript very well... i do now!

    Lee A Newson
  • 04-18-2005 12:54 PM In reply to

    Thanks for updating us on how you solved the issue.

    Shanthi
    InfoPathDev India
    Shanthi Reddy
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.