STARTING NOTEPAD.exe from WEBPAGE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kevin.a.sweeney@gmail.com

    STARTING NOTEPAD.exe from WEBPAGE

    I have a webpage that is on my local machine.
    The page will open NOTEPAD.exe on the local machine.

    My intentions is to have a JAVAscript and a form. It seems that I
    have some code problems:

    Can anyone help?

    The code is listed below:

    <HTML>
    <HEAD>

    <SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
    function executeCommands (inputparms)
    {
    // Instantiate the Shell object and invoke its execute method.

    var oShell = new ActiveXObject(" Shell.Applicati on");

    var commandtoRun = "C:\\WINDOWS\\N otepad.exe";
    if (inputparms != "")
    {
    var commandParms = document.Form1. filename.value;
    }

    // Invoke the execute method.
    oShell.ShellExe cute(commandtoR un, commandParms, "", "open", "1");
    }
    </SCRIPT>

    </HEAD>

    <BODY>
    <FORM name="Form1">
    <CENTER>
    <BR><BR>
    <H1>Execute PC Commands From HTML </H1>
    <BR><BR>
    <File Name to Open:<Input type="text" name="filename" size="20"/>
    <BR><BR>
    <input type="Button" name="Button1" value="Run Notepad.exe"
    onClick="execut eCommands()" />

    <BR><BR>
    <input type="Button" name="Button2" value="Run Notepad.exe with
    Parameters" onClick="execut eCommands(' + hasPARMS + ')" />
    </CENTER>
    </FORM>
    </BODY>

    </HTML>

  • -Lost

    #2
    Re: STARTING NOTEPAD.exe from WEBPAGE

    kevin.a.sweeney @gmail.com wrote:
    I have a webpage that is on my local machine.
    The page will open NOTEPAD.exe on the local machine.
    >
    My intentions is to have a JAVAscript and a form. It seems that I
    have some code problems:
    >
    Can anyone help?
    >
    The code is listed below:
    >
    <HTML>
    <HEAD>
    >
    <SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
    function executeCommands (inputparms)
    {
    // Instantiate the Shell object and invoke its execute method.
    >
    var oShell = new ActiveXObject(" Shell.Applicati on");
    >
    var commandtoRun = "C:\\WINDOWS\\N otepad.exe";
    if (inputparms != "")
    {
    var commandParms = document.Form1. filename.value;
    }
    >
    // Invoke the execute method.
    oShell.ShellExe cute(commandtoR un, commandParms, "", "open", "1");
    }
    </SCRIPT>
    >
    </HEAD>
    >
    <BODY>
    <FORM name="Form1">
    <CENTER>
    <BR><BR>
    <H1>Execute PC Commands From HTML </H1>
    <BR><BR>
    <File Name to Open:<Input type="text" name="filename" size="20"/>
    <BR><BR>
    <input type="Button" name="Button1" value="Run Notepad.exe"
    onClick="execut eCommands()" />
    >
    <BR><BR>
    <input type="Button" name="Button2" value="Run Notepad.exe with
    Parameters" onClick="execut eCommands(' + hasPARMS + ')" />
    </CENTER>
    </FORM>
    </BODY>
    >
    </HTML>
    There are a few things wrong. However, I don't play Internet Explorer.

    And as much as I hate to post this link (only because it is not viewable
    via the web), here it is:

    VK wrote a minimalistic "applicatio n launcher." Hence "al."

    Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!


    Download that and view the HTML document within to get an idea of where
    your code is going bonkers.

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.

    Comment

    • kevin.a.sweeney@gmail.com

      #3
      Re: STARTING NOTEPAD.exe from WEBPAGE

      On Apr 23, 10:57 pm, -Lost <maventheextraw o...@techie.com wrote:
      kevin.a.swee... @gmail.com wrote:
      I have a webpage that is on my local machine.
      The page will open NOTEPAD.exe on the local machine.
      >
      My intentions is to have a JAVAscript and a form. It seems that I
      have some code problems:
      >
      Can anyone help?
      >
      The code is listed below:
      >
      <HTML>
      <HEAD>
      >
      <SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
      function executeCommands (inputparms)
      {
      // Instantiate the Shell object and invoke its execute method.
      >
      var oShell = new ActiveXObject(" Shell.Applicati on");
      >
      var commandtoRun = "C:\\WINDOWS\\N otepad.exe";
      if (inputparms != "")
      {
      var commandParms = document.Form1. filename.value;
      }
      >
      // Invoke the execute method.
      oShell.ShellExe cute(commandtoR un, commandParms, "", "open", "1");
      }
      </SCRIPT>
      >
      </HEAD>
      >
      <BODY>
      <FORM name="Form1">
      <CENTER>
      <BR><BR>
      <H1>Execute PC Commands From HTML </H1>
      <BR><BR>
      <File Name to Open:<Input type="text" name="filename" size="20"/>
      <BR><BR>
      <input type="Button" name="Button1" value="Run Notepad.exe"
      onClick="execut eCommands()" />
      >
      <BR><BR>
      <input type="Button" name="Button2" value="Run Notepad.exe with
      Parameters" onClick="execut eCommands(' + hasPARMS + ')" />
      </CENTER>
      </FORM>
      </BODY>
      >
      </HTML>
      >
      There are a few things wrong. However, I don't play Internet Explorer.
      >
      And as much as I hate to post this link (only because it is not viewable
      via the web), here it is:
      >
      VK wrote a minimalistic "applicatio n launcher." Hence "al."
      >
      Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

      >
      Download that and view the HTML document within to get an idea of where
      your code is going bonkers.
      >
      --
      -Lost
      Remove the extra words to reply by e-mail. Don't e-mail me. I am
      kidding. No I am not.

      This script works like a charm in Mozilla only, I know by you note
      you don't play in IE, but is it possible to get it to work in IE as
      well?

      kevin

      Comment

      • VK

        #4
        Re: STARTING NOTEPAD.exe from WEBPAGE

        On Apr 24, 6:17 pm, kevin.a.swee... @gmail.com wrote:
        his script works like a charm in Mozilla only, I know by you note
        you don't play in IE, but is it possible to get it to work in IE as
        well?
        If you are talking about http://www.geocities.com/schools_ring/al.zip
        then it works for any browser supporting XPCOM or WShell over ActiveX
        hence any Gecko-based browser and IE>=4 (that includes Firefox, IE6,
        IE7)
        Obviously it requires security settings down to low - at the very
        least "Ask before launching unsigned components". If current settings
        are "Never launch unsigned components" then this script will be
        silently disregarded, this is what is happening on your IE. My script
        is targeted to specific intranet solutions with controllable security
        environment. For the default Internet security environment it is
        pretty much useless. For the latter case you need a full standing
        XPCOM/ActiveX module signed by a valid security certificate in order
        to trig security permission dialog client-side.

        Comment

        Working...