run batch file in client side

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • viki

    run batch file in client side

    Hi,
    I want to run the batch file from the client side. I was able to do it
    in the server side by using process. But i want to run from the client
    side , like we do in asp using createobject("w script.shell").

    I tried the same code by using the html control and the client side
    code, but it gives me the error in createobject statement.

    Is there any way to run the batch files in the client, could some one
    help me with the code....

    Thanks in advance,
    Viki
  • David

    #2
    RE: run batch file in client side

    Hi,

    Are you trying to run commands on the users machine via scripting commands
    inside of a webpage?

    Firstly, this would only work if the user is running Internet Explorer as a
    browser.

    Secondly, you would still run in to serious security/permission issues. For
    safety, IE will not let untrusted webpages access to such powerfull objects
    as "wscript.shell" .

    -- David


    "viki" wrote:
    [color=blue]
    > Hi,
    > I want to run the batch file from the client side. I was able to do it
    > in the server side by using process. But i want to run from the client
    > side , like we do in asp using createobject("w script.shell").
    >
    > I tried the same code by using the html control and the client side
    > code, but it gives me the error in createobject statement.
    >
    > Is there any way to run the batch files in the client, could some one
    > help me with the code....
    >
    > Thanks in advance,
    > Viki
    >[/color]

    Comment

    • viki

      #3
      Re: run batch file in client side

      Hi David,
      Thanks for the reply, yes i want run the commands on the users machine
      .. This is a intranet web , and everyone are using IE.

      Could u please explain me how could i do this and what is the
      security/permission issues i have to overcome inorder to do this...

      Thanks,
      Viki
      "David" <David@discussi ons.microsoft.c om> wrote in message news:<54588984-AF11-4A48-9C75-86C0C6CD5CFD@mi crosoft.com>...[color=blue]
      > Hi,
      >
      > Are you trying to run commands on the users machine via scripting commands
      > inside of a webpage?
      >
      > Firstly, this would only work if the user is running Internet Explorer as a
      > browser.
      >
      > Secondly, you would still run in to serious security/permission issues. For
      > safety, IE will not let untrusted webpages access to such powerfull objects
      > as "wscript.shell" .
      >
      > -- David
      >[/color]

      Comment

      • Saravana

        #4
        Re: run batch file in client side

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

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

        var commandtoRun = "Applicatio n Path";

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


        --
        Saravana




        "viki" <freetorn2002@y ahoo.ca> wrote in message
        news:deb17ac9.0 411141709.6c878 559@posting.goo gle.com...[color=blue]
        > Hi David,
        > Thanks for the reply, yes i want run the commands on the users machine
        > . This is a intranet web , and everyone are using IE.
        >
        > Could u please explain me how could i do this and what is the
        > security/permission issues i have to overcome inorder to do this...
        >
        > Thanks,
        > Viki
        > "David" <David@discussi ons.microsoft.c om> wrote in message[/color]
        news:<54588984-AF11-4A48-9C75-86C0C6CD5CFD@mi crosoft.com>...[color=blue][color=green]
        > > Hi,
        > >
        > > Are you trying to run commands on the users machine via scripting[/color][/color]
        commands[color=blue][color=green]
        > > inside of a webpage?
        > >
        > > Firstly, this would only work if the user is running Internet Explorer[/color][/color]
        as a[color=blue][color=green]
        > > browser.
        > >
        > > Secondly, you would still run in to serious security/permission issues.[/color][/color]
        For[color=blue][color=green]
        > > safety, IE will not let untrusted webpages access to such powerfull[/color][/color]
        objects[color=blue][color=green]
        > > as "wscript.shell" .
        > >
        > > -- David
        > >[/color][/color]


        Comment

        • viki

          #5
          Re: run batch file in client side

          Hi Saravana,
          I got it, Thanks a lot.

          Now i am going to ask u another help. Actually i am executing this on
          a web control, i want the server side on click event to wait until the
          client side onclick event(shell execute) finishes the processing...

          thanks in advance,
          Viki



          "Saravana" <saravank@sct.c o.in> wrote in message news:<eHXld.288 8$ho7.2148@news .cpqcorp.net>.. .[color=blue]
          > You can try this,
          > <SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
          > function executeCommands ()
          > {
          > // Instantiate the Shell object and invoke
          > //its execute method.
          >
          > var oShell = new ActiveXObject(" Shell.Applicati on");
          >
          > var commandtoRun = "Applicatio n Path";
          >
          > // Invoke the execute method.
          > oShell.ShellExe cute(commandtoR un, "", "", "open", "1");
          > }
          > </SCRIPT>
          >
          >
          > --
          > Saravana
          > http://dotnetjunkies.com/WebLog/saravana/
          > www.ExtremeExperts.com
          >
          >[/color]

          Comment

          • Saravana

            #6
            Re: run batch file in client side

            I dont think it is possible to make server side code to wait till client
            side code executes. What you can do is, do all your server work in
            serverside onclick event. Finally in that event, use
            page.registerst artupscript method to register client side code which has to
            be executed when the page is rendered. If you need more details, then get
            back to me.

            --
            Saravana




            "viki" <freetorn2002@y ahoo.ca> wrote in message
            news:deb17ac9.0 411150749.5b38b 7bc@posting.goo gle.com...[color=blue]
            > Hi Saravana,
            > I got it, Thanks a lot.
            >
            > Now i am going to ask u another help. Actually i am executing this on
            > a web control, i want the server side on click event to wait until the
            > client side onclick event(shell execute) finishes the processing...
            >
            > thanks in advance,
            > Viki
            >
            >
            >
            > "Saravana" <saravank@sct.c o.in> wrote in message[/color]
            news:<eHXld.288 8$ho7.2148@news .cpqcorp.net>.. .[color=blue][color=green]
            > > You can try this,
            > > <SCRIPT type="text/javascript" LANGUAGE="JavaS cript">
            > > function executeCommands ()
            > > {
            > > // Instantiate the Shell object and invoke
            > > //its execute method.
            > >
            > > var oShell = new ActiveXObject(" Shell.Applicati on");
            > >
            > > var commandtoRun = "Applicatio n Path";
            > >
            > > // Invoke the execute method.
            > > oShell.ShellExe cute(commandtoR un, "", "", "open", "1");
            > > }
            > > </SCRIPT>
            > >
            > >
            > > --
            > > Saravana
            > > http://dotnetjunkies.com/WebLog/saravana/
            > > www.ExtremeExperts.com
            > >
            > >[/color][/color]


            Comment

            • viki

              #7
              Re: run batch file in client side

              Thanks Saravana, I will give a try ...

              viki
              "Saravana" <saravank@sct.c o.in> wrote in message news:<M2lmd.296 9$xc1.2090@news .cpqcorp.net>.. .[color=blue]
              > I dont think it is possible to make server side code to wait till client
              > side code executes. What you can do is, do all your server work in
              > serverside onclick event. Finally in that event, use
              > page.registerst artupscript method to register client side code which has to
              > be executed when the page is rendered. If you need more details, then get
              > back to me.
              >
              > --
              > Saravana
              > http://dotnetjunkies.com/WebLog/saravana/
              > www.ExtremeExperts.com
              >[/color]

              Comment

              Working...