Can We Call a VB Standard EXE from ASP page
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: Can We Call a VB Standard EXE from ASP page

  1. #1
    Join Date
    Oct 2001
    Location
    India
    Posts
    5

    Can We Call a VB Standard EXE from ASP page

    Can We Call a VB Standard EXE from ASP page ?

  2. #2
    Join Date
    Dec 2001
    Posts
    6,330
    If you have the exe registered on the server, then you probably can on the server side. If you want to do it client-side, then you are really out of luck, unless you have the user click on a file that opens in a particular program or something, but that may open a dialog, and you can't control what program they have associated with the file type.

  3. #3
    Join Date
    Aug 2002
    Location
    india
    Posts
    44

    Can We Call a VB Standard EXE from ASP page ?

    hello WizBang

    Can you plz elaborate on that,I'm trying to do just the same and it would be helpful if you could tell me some more on the topic.

    Have a nice day

    anuvb

  4. #4
    Join Date
    Dec 2001
    Posts
    6,330
    You will need permission from your Web hosting service in order to do it. They will have to register it before you can use it. Then it will be available like any other component you use in ASP.

  5. #5
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Once I did from asp to com+ to standard exe

    Once I did it this way:
    From asp pages -> to a com+ component (=a dll under Mts);
    from the Dll component shelled to exe standard. BUt rebember: user from asp page will not interact with standard exe. You should use this last one for batch purpouses only...
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  6. #6
    Join Date
    Dec 2002
    Location
    India
    Posts
    76
    if u want to use the standard exe in ur server..

    use the wscript object

    set WshShell = server.CreateObject("WScript.Shell")

    wshShell.Run <the entirecommad line like argument>

    which includes the total physical path and the command line arguments if any u like to pass to the exe.

    hope this helps

  7. #7
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Nice! Only a small adjustment...

    ..to make it work in a Vbs file:
    Code:
    Dim WshShell
    'remove the "server." part to run this clientside
    set WshShell = CreateObject("WScript.Shell") 
    'this is path to notepad in win2k
    'You should have enough priviledges to run it...
    WshShell.Run "c:\winnt\system32\notepad.exe"
    set WshShell= nothing
    Good answer, DeivaGanesh. 5 stars for you.
    Cesare Imperiali
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  8. #8
    Join Date
    Aug 2007
    Posts
    1

    Re: Can We Call a VB Standard EXE from ASP page

    This is a pretty old post but I guess I'll ask anyway. I tried to execute an .exe from my asp page using the Wscript.Shell method but it doesn't seem to work right. It's not throwing an error and the taskmanager says that the program is running buy it doesn't actually appear on the desktop and it doesn't execute the code in the exe.

    I've tried to set permissions on the iusr and iwam accounts, actually i've given full control to everything but it still doesn't work.

    Any ideas?

  9. #9
    Join Date
    Jan 2003
    Location
    7,107 Islands
    Posts
    2,487

    Re: Can We Call a VB Standard EXE from ASP page

    are you trying to run an EXE on the server or on the client?
    Busy

  10. #10
    Join Date
    Jun 2004
    Location
    Kashmir, India
    Posts
    6,808

    Re: Can We Call a VB Standard EXE from ASP page

    Well it is working. However it is working under a different account. This is not the right way of doing this. You would rather create an ActiveX Exe and then use it. What exactly does this EXE do?

  11. #11
    Join Date
    Aug 2004
    Location
    Mumbai,INDIA
    Posts
    144

    Unhappy Re: Can We Call a VB Standard EXE from ASP page

    hi all,

    First of thanxs for this thread.I could now run my VB exe through ASp code.


    Code:
     
    <html> 
    <head> 
    <script language="VBScript"> 
    	Sub Scan 
    		Set objShell = CreateObject("Wscript.Shell")
     
    		'objShell.Run "C:\Prjtracker.exe"
    		objshell.Exec "C:\Prjtracker.exe" 
     
    	End Sub
    </script> 
    </head> 
    <body> 
    <button onclick="Scan">Click</button> <p>
    </body> 
    </html>
    i want to pass username & password in prjtracker.exe then how can i do that using Wscript.Shell or is there any other way?
    Ritik D Dodhiwala
    Software Devloper
    Mumbai,India
    [IF MY SUGGESTIONS WORKS POSITIVLY PLEASE RATE POSITIVLY ]

  12. #12
    Join Date
    Dec 2001
    Posts
    6,330

    Re: Can We Call a VB Standard EXE from ASP page

    Quote Originally Posted by RITIK
    i want to pass username & password in prjtracker.exe then how can i do that using Wscript.Shell or is there any other way?
    If Wscript.Shell operates the same as VB's Shell, then here's the first thing I'd try:
    Code:
    "C:\MyProgram.exe """ & "name=" & username & "&pass=" & password & """"
    This obviously uses an equals sign to denote where the data is, and an ampersand as a delimiter. What you use in your program is up to you.
    Please remember to rate the posts and threads that you find useful.
    How can something be both new and improved at the same time?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center