Solved

Execute an .exe application from .asp page

Posted on 2001-09-16
21
225 Views
Last Modified: 2012-06-27
I'd to launch an .exe application from my asp page.
What have I do?
Does the System VB command exist?
Regards
0
Comment
Question by:cbonjovi
  • 7
  • 5
  • 4
  • +3
21 Comments
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 6485945
Do you want the .exe to launch on the server or client side? My understanding is that you cannot automatically launch an .exe on the client side unless the user clicks on the link and then either executes or downloads the .exe.

You can launch server-side .exe's, but I am not sure what it is that you want to do exactly.

Fritz the Blank
0
 
LVL 15

Expert Comment

by:robbert
ID: 6485991
a) Set objShell = CreateObject("WScript.Shell")
objShell.Run "c:\myFile.exe"

Regarding security issues (the command will be executed either in the context of user SYSTEM or IUSR_MACHINENAME or whoever has logged on) see:
INFO: The Run Method of the Wscript.shell Object Executes Commands in System Context in IIS
http://support.microsoft.com/support/kb/articles/Q278/3/19.ASP

b) Free AspExec component: www.serverobjects.com/products.htm#free

-- If there are further questions, ask.
0
 
LVL 1

Expert Comment

by:LCP
ID: 6487049
If you want to wait until the exe application finished, you make need to use API call within an activeX COM to execute the executable.

0
 

Author Comment

by:cbonjovi
ID: 6492772
With:
objShell.Run "c:\inetpub\wwwroot\notepad.exe"
application doesn't start.
What have I to set?
0
 
LVL 15

Expert Comment

by:robbert
ID: 6492813
At the client or at the server side?
0
 

Author Comment

by:cbonjovi
ID: 6493064
I want to launch an application on server side
0
 
LVL 15

Accepted Solution

by:
robbert earned 40 total points
ID: 6494693
HOWTO: Access the Desktop from ASP, CGI, or ISAPI
http://support.microsoft.com/directory/article.asp?ID=KB;EN-US;Q241170
See the sections MORE INFORMATION, Interact with Desktop.

Well, after enabling that and executing the .Run command, notepad.exe will be running (see Task Manager) but invisibly -- both at the server and the client.

Nevertheless, you can call other applications that way, i.e., do a DOS Ping, and retrieve its return value.
I guess you're trying to do something by inappropriate means -- what would you like to achieve, expressed in non-technical terms?
0
 

Author Comment

by:cbonjovi
ID: 6495933
OK, found notepad in TaskManager.
Now my aim is to quit notepad from asp script.
Is there a WScript.Shell method?
0
 

Author Comment

by:cbonjovi
ID: 6496000
I cant quit notpad in any way, neither in Task Manager!
0
 
LVL 15

Expert Comment

by:robbert
ID: 6496038
Notepad isn't meant and built to be executed from web services -- it's a desktop application. -- You can kill it either after stopping the IISAdmin service or rebooting. -- Forget running Notepad that way, and rather tell us in non-technical terms what you'ld like to achieve.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:cbonjovi
ID: 6496092
OK, I see.
My aim is control start&kill an application (.exe) from an .asp page. This application is completly separated and asp has not to wait for it, only launch it and, in any other time, be able to kill it (my idea was to record the pid in a txt file and use it to kill...)
That's all.
0
 
LVL 15

Expert Comment

by:robbert
ID: 6496114
There are limits with apps that have user interfaces, as you have experienced.
To kill an application you would write your own VB DLL. There might be additional issues in security, and probably, you would put that DLL into a COM+ package, to run under in admin's security context.
If you wanted to go through that I could grab some sample code and introduce you to COM+ security concepts, but...
0
 

Author Comment

by:cbonjovi
ID: 6496121
I'd prefer not using VB DLL component.
My app doesn't have a user interface, but is a sort of daemon (is a console apllication that run an H.323 listener!)
0
 

Author Comment

by:cbonjovi
ID: 6512605
0
 

Expert Comment

by:docfxit
ID: 6897862
Hi robbert ,

Would you by chance know how to put the run line below into a clickable link?

Set objShell = CreateObject("WScript.Shell")
                        objShell.Run "c:\myFile.exe"

Thanks,

Gary
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 6898033
I don't believe that you can; the vbscript runs server side while the clickable link takes place on the client. So even if you code the above as a link, it will return an error. You can, however, link to a new page (or refresh the current one) in such a way to run the code server side.

Fritz the Blank
0
 

Expert Comment

by:docfxit
ID: 6898137
Hi Fritz the Blank,

Could we please take this question to
http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=asp&qid=20281459

I don't own this question ID and I would like to be able to give you the points if you find an answer for me.
I do own the referenced question ID.

Thanks,

Gary

PS:  I will reply to this in the other question.
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8579982
So, where are we with this?

Please close this question out by accepting the comment that helped you the most as an answer.

Fritz the Blank
0
 
LVL 7

Expert Comment

by:lavinder
ID: 8804643
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept a comment - robbert
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
lavinder
EE Cleanup Volunteer
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 8805647
That sounds good to me,

Fritz the Blank
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now