Click here to Skip to main content
15,895,709 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have an exe file on client machine that I want to call by shell command from my asp.net. How can I call it from asp.net? When I gave it the path ex: C:/App/app.exe it went to the server C: directory and I have a text file located also on client machine that I want to add data to it and then read then to database, also same problem when i gave it the path for the text file on client machine ex: c:/App/app.txt it located the file on server and not the one on client machine.

How can I make it take the path on client machine from server side code?
Posted

1 solution

Basically, unless there are very special conditions which do not apply in 99.99% of installations, you can't do it.

If your user is using IE, and they have ActiveX enabled, then you can. But otherwise no.

Think about it: if you could do it for legitimate reasons, malicious sites could do it as well....
 
Share this answer
 
Comments
[no name] 7-Dec-13 2:55am    
Ok here is my situation I have a barcode reader on cleint side and I want when button click to call exe file through shell command to read data from barcode to a text file then read the text file and insert the data on sql server database. but when I gave the path for exe and the txt file it open the one on server and not the files on client side... What can I do her to communicate with client side through asp.net
OriginalGriff 7-Dec-13 3:32am    
You can't - unless you can persuade the client to use IE and enable ActiveX controls.
Sorry - security is against you here!
[no name] 9-Dec-13 3:10am    
I need to make it happen can you help me?
OriginalGriff 9-Dec-13 4:19am    
I cannae change the laws of computin' captain!

Can I make your users use IE? No.
Can I make the ones that do enable ActiveX controls despite all the security warnings they will get telling them it's a silly idea? No.
Can I make those that do enable them install an ActiveX control from you? No.
Can I write an ActiveX control for you so the the one person left who can run it will do so? No. That is definitely your job! :laugh:
[no name] 9-Dec-13 5:21am    
So how can I move data from the device on client side to my database?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900