C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




How to run the exe file from ASP.Net


Posted Date: 07 Sep 2008      Total Responses: 8

Posted By: imtyaz       Member Level: Silver     Points: 1



Dear all,

ASP.net C#
===============
I am trying to run server side exe file with the below code
nothing is happening even there is no error also

Can anyone suggest me to run the exe file

CODE
======================
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = "C:\\foldername\\test.exe";
p.Start();


Thanks and regards





Responses

Author: Ritesh N. Jain    07 Sep 2008Member Level: GoldRating:     Points: 1

Make sure ASP.NET account under which application is running should have enough access to execute the files.Also let us know what version of IIS are you using?Also check on server if exe is running on task manager or not?


Author: Satish Kumar J    07 Sep 2008Member Level: DiamondRating:     Points: 6

Please provide us exact error message so that we can identify the problem.

and you can also try following.

System.Diagnostics.Process.Start(@"C:\foldername\test.exe");


HTH

Regards,
Satish



Author: AbidiP    08 Sep 2008Member Level: GoldRating:     Points: 6

string t = Server.MapPath("Filename.exe");
if (System.IO.File.Exists(t))
{
System.Diagnostics.ProcessStartInfo PStartInfo = new System.Diagnostics.ProcessStartInfo(Server.MapPath("Filename.exe"));
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo = PStartInfo; process.Start(); process.WaitForExit();
BtnSave.Enabled = false;

}



Author: ramya    08 Sep 2008Member Level: GoldRating:     Points: 6

try dis

System.Diagnostics.Process.Start(@"C:\foldername\test.exe");



Author: imtyaz    08 Sep 2008Member Level: SilverRating:     Points: 3

I have checked the following detail .....

1. I have ASPNET account under that application
2. ASPNET having the full access
2. IIS version is 5.1
3. Exe is not running in any windows scheduler
4. There is no error in my code

But still it is not executing the exe

Thanks



Author: Ritesh N. Jain    08 Sep 2008Member Level: GoldRating:     Points: 2

normally ASPNET account udner which Web app is running have Admin access to folder in which exe is kept or if that exe than it shouldn't be a problem.

also have a look at this MS KB sure it will help you.

http://support.microsoft.com/default.aspx?scid=kb;en-us;555134



Author: imtyaz    09 Sep 2008Member Level: SilverRating:     Points: 2

Dear Ritesh,

i have done all the steps as following link

http://support.microsoft.com/default.aspx?scid=kb;en-us;555134

But still application is not opening

Is there anything that i need to change in web.config file


Please suggest me

Thank for reply







Author: Ritesh N. Jain    09 Sep 2008Member Level: GoldRating:     Points: 2

Another thing that can try is to run you application with impersonated account(admin) and see if it work out or not.Also try with another application like notepad and see if your application is able to exeucte it or not.


Post Reply
You must Sign In to post a response.
Next : Why should I create an instance of a class?
Previous : what is it meaning? what purpose use?
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use