IT Community - Software Programming, Web Development and Technical Support

How to run a exe from a web application?

This is a discussion on How to run a exe from a web application? within the C# Programming forums, part of the Software Development category; Hi All, This is an intranet application, so all execute permissions are granted. I need to run a 3rd party ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C# Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 08-29-2007, 05:14 AM
a.deeban a.deeban is offline
D-Web Analyst
 
Join Date: May 2007
Posts: 279
a.deeban is on a distinguished road
Default How to run a exe from a web application?

Hi All,

This is an intranet application, so all execute permissions are granted. I need to run a 3rd party application from a page on the site that I'm developing. I'd like to be able to run either locally on the client or on the server. how do I do this in C#?

thnx...
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 08-29-2007, 05:17 AM
Sundaram Sundaram is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Location: chennai
Posts: 117
Sundaram is on a distinguished road
Send a message via MSN to Sundaram Send a message via Yahoo to Sundaram
Default Re: How to run a exe from a web application?

Hi Deeban,

This should point you in the right direction:

using System.Diagnostics;

...

string sProcess = @"C:\windows\system32\notepad.exe";

Process p = new Process();

p.StartInfo.FileName = sProcess;

p.Start();

Regards,
M.Sundaram
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-29-2007, 05:42 AM
smani smani is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 56
smani is on a distinguished road
Default Re: How to run a exe from a web application?

hi sundaram,
i tried your code, its works fine, but i tried to open my own exe file created through my windows setup,
it causes exception:"The specified executable is not a valid Win32 application."

any idea?

Thx
Manivannan.s
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-29-2007, 06:06 AM
smani smani is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 56
smani is on a distinguished road
Default Re: How to run a exe from a web application?

Quote:
Originally Posted by Sundaram View Post
Hi Deeban,

This should point you in the right direction:

using System.Diagnostics;

...

string sProcess = @"C:\windows\system32\notepad.exe";

Process p = new Process();

p.StartInfo.FileName = sProcess;

p.Start();

Regards,
M.Sundaram
hi sundaram,
Its working fine,
i gave path to shortcut.. so its fails previously..

now its working.
Process p = new Process();

string sProcess = @"C:\\Program Files\\LSI-Setup\\Application.exe";
p.StartInfo.FileName = sProcess;
p.StartInfo.UseShellExecute = false;
p.StartInfo.CreateNoWindow = false;
p.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
p.Start();


Thx a lot
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 08-29-2007, 10:50 PM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Smile Re: How to run a exe from a web application?

Hi buddies,

Really helps ur codings...

But I need how to run an exe from JavaScript...

Any Idea?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 08-30-2007, 02:54 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: How to run a exe from a web application?

Hi buddies,

Here is sample code for how to run an exe from JavaScript...

Code:
<html>
<title>Run an EXE using JavaScript by Vinothnat</title>
<body>
<h1 style="color:Maroon">Run an EXE using JavaScript by Vinothnat</h1>
<br /><br />
<input onclick=OpenApplication() type=button value="ClickMe" name=button1>
<script language="javascript" type="text/javascript">
function OpenApplication()
{  
        alert("IE");
        var shell=new ActiveXObject("WScript.shell");
        shell.run("C://Cleanup.exe",1,true);
}
</script>
</body>
</html>
But this will work only in IE...I don't know how to run a shell in firefox....

If anybody could pls....
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chat Application Manikandan.S ASP and ASP.NET Programming 4 03-24-2008 04:50 AM
Application has failed to start because the application configuration is incorrect kingmaker ASP and ASP.NET Programming 5 01-03-2008 03:18 AM
Mobile Application vigneshgets Software Testing 1 11-05-2007 11:52 PM
debugging an Asp.net web application simplesabita Software Testing 1 08-18-2007 12:55 AM
difference between client server application testing & web application testing vigneshgets Software Testing 1 07-27-2007 05:28 AM


All times are GMT -7. The time now is 11:21 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0