Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# ASP.NET Javascript IIS
Hi.
I have created an ASP application, there I need to run a .exe and send it some parameters, right now I'm able to do this with process.start() but just when I'm in debugging mode (Directly from Visual Studio).
I have been reading a little and I found that for security reasons I'll not be able to do this...
Is there any way to perform this? like a script or something?
The principal problem is that I need to send parameters to the .exe
Thanks in advance
 
Note: This is for an Intranet Site in my job, and it's absolutely necessary to do this.
Posted 8-Aug-12 12:04pm
Edited 8-Aug-12 12:42pm
v2
Comments
Christian Amado at 8-Aug-12 17:19pm
   
Absolutely. You should never do that! What does your "clients" think about their compromised security?
EddyGuzman at 8-Aug-12 17:41pm
   
It's an intranet site, it's absolutely necessary to do this.
Christian Amado at 8-Aug-12 17:49pm
   
Remember that you have limited access to the client machine. You can try with System.Diagnostics.Process...
Sergey Alexandrovich Kryukov at 8-Aug-12 18:37pm
   
System.Diagnostics.Process? What are you event talking about? Well, it will run -- on the server host.
--SA
Christian Amado at 8-Aug-12 18:58pm
   
A class. http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx
EddyGuzman at 8-Aug-12 19:36pm
   
As SA says, with Diagnostic.Process is going to run but just in the server, thanks anyway
Christian Amado at 8-Aug-12 19:37pm
   
Yeap. As you said.
Sergey Alexandrovich Kryukov at 8-Aug-12 19:46pm
   
Yes, this one. Will start a process on a caller's machine.
--SA
Sergey Alexandrovich Kryukov at 8-Aug-12 18:36pm
   
Tell your "absolutely necessary" to somebody else. What is somebody tells you that flying faster than speed of light is "absolutely necessary"? (To meed a deadline :-).
You cannot and should not do this. Internet or intranet, does not matter. Period.
--SA
Sergey Alexandrovich Kryukov at 8-Aug-12 18:40pm
   
Of course, you can always do it with ActiveX object on IE. I don't want to discuss it. Better don't do it, to stay out of trouble. Talk to those who demand the solution that this is "absolutely impossible", in worst case.
--SA
EddyGuzman at 8-Aug-12 19:40pm
   
Sorry, but it can't be impossible...I have been thinking and maybe adding the exe into the application will do the job, the problem (It is on my server, I click, explorer gives me the option to run, I click run, voila!...but how to pass the parameters...)
I already try with ActiveX object but looks like it doesn't work with IE8 and forward...
Sergey Alexandrovich Kryukov at 8-Aug-12 19:48pm
   
Did you mean, if cannot be possible? If you think it's possible, please go find it. This is impossible for a good reason: it is not needed, but the opposite -- impossibility to do anything with client computer -- is very much needed.
--SA
Wes Aday at 8-Aug-12 17:48pm
   
You can read through http://stackoverflow.com/questions/7204742/run-exe-on-client-system-from-server-side-c-sharp-code and see if anything there helps.
mark merrens at 8-Aug-12 18:05pm
   
What does the exe do? Can you emulate it's process through the intranet? In other words, if it is processing data that can done directly form your web application.
EddyGuzman at 8-Aug-12 19:41pm
   
The exe is an old application made in Delphi, we're working on change it to a newer platform but it isn't a priority right now, so I need to run it from my application from now.
Volynsky Alex at 8-Aug-12 18:49pm
   
http://social.msdn.microsoft.com/forums/en-US/csharpgeneral/thread/2b714d4f-
Please read following:
92c1-4bd3-8ff1-226a278d129c/
http://stackoverflow.com/questions/8061362/starting-a-process-from-asp-net-why-does-the-process-immediately-die
http://forums.iis.net/p/1174735/1967915.aspx
raman.rsystems at 20-Nov-12 2:03am
   
You can do that if client side application is your. then by making custom protocol you can do entetry into client registery and next time you can open or close or any operation on client side exe

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Your 2 major choices are write an AX object to call it, or an NPAPI plugin to do it ... as others have said, that creates a gaping security hole, so engineer the plugin/ax to ONLY call the known exe - I'd CRC check it too if I were you
 
You mention it's written in delphi - you may be lucky, delphi creates IDispatch objects left, right and centre - have a look at the exe with oleview.exe - you may find something in there you can directly invoke via script (in IE only) via ActiveXObject[^]
  Permalink  
Comments
EddyGuzman at 9-Aug-12 18:28pm
   
Thanks this worked perfect...I know that what I did wasn't the best approach but it helps me for the moment...I just changed the security configuration in explorer to run activeX, it isn't really harmful because our network is protected (Except for the manager and me, No one else can add files to the Network folder in where the exe is located). As you said I made the ax to call only the known exe...Thanks a lot, and sorry for the delay in my response
neerajkumarmodi at 14-Feb-13 3:34am
   
Can you share how you are running exe on web application
EddyGuzman at 20-Feb-13 19:52pm
   
function Launch() {
var launcher = new ActiveXObject("Shell.Application");
launcher.ShellExecute("where_is_your_exe\\file.exe", "<%=userId%>", "", "open", "1");
}

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 DamithSL 295
1 OriginalGriff 214
2 BillWoodruff 170
3 Zoltán Zörgő 165
4 Maciej Los 113
0 OriginalGriff 7,760
1 DamithSL 5,874
2 Sergey Alexandrovich Kryukov 5,444
3 Maciej Los 5,076
4 Kornfeld Eliyahu Peter 4,539


Advertise | Privacy | Mobile
Web04 | 2.8.141223.1 | Last Updated 8 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100