How can I invoke an EXE from Web...  
Author Message
raj.ramesh





PostPosted: JScript for the .NET Framework, How can I invoke an EXE from Web... Top

Hi ...,

I have a ASP.Net Web page in a server..


When access using server IP Address...,
On loading of that page I want to invoke an EXE which is in the local system..

Can Anyone help

Regards..

Ramesh R.


.NET Development29  
 
 
Jaiprakash Sharma





PostPosted: JScript for the .NET Framework, How can I invoke an EXE from Web... Top

Hi,

What i understand from your post is that you want to run some exe through Jscript .net code. Since Jscript .Net is a managed language, you can use System.Diagnostics.Process class to create a new process and run that exe. Just enure that you have the permissions to do so on that machine.

Thanks.



 
 
troy2





PostPosted: JScript for the .NET Framework, How can I invoke an EXE from Web... Top

Here's some code:

var myExe : System.Diagnostics.Process = new System.Diagnostics.Process();
myExe.StartInfo.FileName =
"my.exe"
;
myExe.StartInfo.Arguments =
""
;
myExe.Start();

Don't expect this to work on the client. It doesn't use .NET. It will leave the exe running in memory in some cases which could come back to haunt you.


 
 
Jaiprakash Sharma





PostPosted: JScript for the .NET Framework, How can I invoke an EXE from Web... Top

Hi,

Above code snippet runs on .net CLR. System.Diagnostics.Process is one of the Classes in BCL.

Thanks.