Pass parameter to executable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vinvik
    New Member
    • Aug 2007
    • 16

    Pass parameter to executable

    hi am calling one exe from java script using window.open..
    now i need to pass parameter to that exe.. and that exe accepts the parameter from command line using(variable= command$)..

    now how i can pass parameter to that exe through javascript..

    plz solve..

    thanx....
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    By command line, do you mean address bar?

    Show your code and please only use bold for emphasis.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      I've changed the thread title for you. Please use a good thread title.

      Comment

      • vinvik
        New Member
        • Aug 2007
        • 16

        #4
        command line means command prompt(ms dos) i said..

        in promt

        c:\pit\vb.exe abcd
        here abcd is parameter

        the vb.exe accepts this through
        variable=comman d$ code

        now i want pass that parameter abcd from java script

        am calling that vb.exe using java script only using

        window.open(vb. exe);

        now how can i pass abcd to this exe...?

        Comment

        • acoder
          Recognized Expert MVP
          • Nov 2006
          • 16032

          #5
          Have you tried:
          Code:
          "vb.exe?abcd=" + abcd

          Comment

          • vinvik
            New Member
            • Aug 2007
            • 16

            #6
            thats not working..

            see in that vb.exe in form load i write this code to acceses parameter

            Private Sub Form_Load()
            Dim path As String
            path = Command$
            End Sub

            and in javascript(.net ) i write this code to execute that exe

            function openWin()
            {
            window.open('ht tp://localhost/PoliceITWebSetu p/vb.exe');
            }
            now here i want to pass parameter to that exe.. the parameter is like this

            "localhost/projectname/"

            and another prob is

            when i call that exe through window.open
            2 popup will raise
            file dowload n save
            like when a zip file going to extract
            after that my exe going to execute..

            plz help me to pass parameter through javascript..

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              Can you run this yourself manually using a parameter of your choice?

              Comment

              • vinvik
                New Member
                • Aug 2007
                • 16

                #8
                well.. using command prompt i can pass parameter to exe its working..
                now i need syntax how to pass from java script..

                Comment

                • Kelicula
                  Recognized Expert New Member
                  • Jul 2007
                  • 176

                  #9
                  I don't gbelieve it possible javascript was never intended to operate outside of the DOM.

                  Comment

                  • vinvik
                    New Member
                    • Aug 2007
                    • 16

                    #10
                    Originally posted by Kelicula
                    I don't gbelieve it possible javascript was never intended to operate outside of the DOM.


                    so u are tellin there is no posibility to pass parameter from javascript to exe application..

                    Comment

                    • gits
                      Recognized Expert Moderator Expert
                      • May 2007
                      • 5388

                      #11
                      Originally posted by vinvik
                      so u are tellin there is no posibility to pass parameter from javascript to exe application..
                      exactly ;) ... there is no way for javascript to break out of the browser ... except of writing a cookie to you system. in case you use IE there might be some ActiveX-controls that may allow to call an exe and pass params to it ... but that wouldn't be possible with other browsers ... and shouldn't be ... imagine a website that may call something at your machine and pass params to that ... ;) sombody may send you machine to hell with that possibility ;))

                      kind regards

                      Comment

                      • vinvik
                        New Member
                        • Aug 2007
                        • 16

                        #12
                        Originally posted by gits
                        exactly ;) ... there is no way for javascript to break out of the browser ... except of writing a cookie to you system. in case you use IE there might be some ActiveX-controls that may allow to call an exe and pass params to it ... but that wouldn't be possible with other browsers ... and shouldn't be ... imagine a website that may call something at your machine and pass params to that ... ;) sombody may send you machine to hell with that possibility ;))

                        kind regards
                        thanks for reply..

                        is there any possible other ways, i mean to say not using java script because am using vb.net.. so through code behind...?

                        Comment

                        • gits
                          Recognized Expert Moderator Expert
                          • May 2007
                          • 5388

                          #13
                          hi ...

                          you want to do something 'security-critical' on the client-machine ... as i said may be with some ActiveX-controls for IE that might be possible ... i don't know about other things that might do that ... because it simply shouldn't be done!

                          kind regards

                          Comment

                          • vinvik
                            New Member
                            • Aug 2007
                            • 16

                            #14
                            Originally posted by gits
                            hi ...

                            you want to do something 'security-critical' on the client-machine ... as i said may be with some ActiveX-controls for IE that might be possible ... i don't know about other things that might do that ... because it simply shouldn't be done!

                            kind regards
                            hmmm.. i understand.. but i have to do this through java script only.. okay then i will try with other ways.. thanx..

                            Comment

                            • vinvik
                              New Member
                              • Aug 2007
                              • 16

                              #15
                              thanks to every one who help me..

                              Comment

                              Working...