Link to home
Start Free TrialLog in
Avatar of Bob Butcher
Bob ButcherFlag for United States of America

asked on

starting an exe program using response.redirect in ASP

Is it possible to use response.redirect to start an exe job in ASP?

I thought I had this working at one time.

My code is trying to do a response.redirect "\\server\folder\myjob.exe" but instead what happens is the browser adds "http://webserver" in front of the "\\server\folder\myjob.exe".

Any one have any ideas why this happens? I am fairly certain that this might have worked before and I haven't monkeyed around with this code in a while.

TIA.
Avatar of B_Dorsey
B_Dorsey

I would highly doubt this would work, or else we would have tons of websites opening our mailprograms and other crap without our consent.

b
ASKER CERTIFIED SOLUTION
Avatar of Morcalavin
Morcalavin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob Butcher

ASKER

on the client machine.
This is only possible via IE using an active-x object and javascript.

Take a look at the question below to find a solution:
https://www.experts-exchange.com/questions/22036539/How-to-have-an-image-link-on-the-web-page-to-launch-an-application-on-the-local-machine.html
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This code was already in place and working when I took over as a web developer here. The problem is that we upgraded all of our servers from Windows 2000 and Windows NT to Windows 2003.

The piece of code - response.redirect "\\server\folder\job.exe" was working fine in ASP or so I was told.

I guess I could remove the code because the application really isn't necessary now to run and yes, a script, would work and so the same thing.

I guess for my own sanity I wanted to understand how it worked because I had never seen anything like that in ASP before.
my initial guess would be that it is part of an extranet/server farm of some sort.   I've never been able to get a UNC path to work before, however I have heard (or rather seen) that if you can clone the IUSR machine on the web server to server B something like this should work....

I wonder if a server.transfer or server.execute may be better to use.....but than again, personally I think that any script that calls an executable file is just a security breach waiting to happen, as the permissions needed for the executable to be executed are ISUR_ needs to have full control of the file, and possibly even the folder that contains it.

I've seen an instance where a client wanted to use ImageMagick component to resize their images (they didn't want to shell out for a proper component)
What ended up happenning was the server got compromised, becase basically what we were supposed to do to make it work was shell out, and run the resizer via cmd.exe...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@ThinkPaper, I mostly agree to what everyone has posted here. But again:

> instead what happens is the browser adds "http://webserver" in front of the "\\server\folder\myjob.exe".

> on the client machine.

> This code was already in place and working

lead me to guess (wildly) that the users might have been all the while running "\\server\folder\myjob.exe" from their own machines e.g. from Start->Run or other scripts/programs. Thus the simple HTML link:

<a href="\\server\folder\myjob.exe">Run myjob</a>

may have the slightest possibility of being what was sought after :)
gete: ah. another possiblity i haven't thought of. =)
The application did work before. It automatically redirected to an application that did reside on the user machine.

Little bit of history.

We are in upstate NY. Hit with major flooding in June 2006, wiped out entire data center. Our servers were older Windows NT/2000 servers and everything was destroyed. Rebuilt data center, installed Windows 2003 servers, restored all data and then this web applicaton, that was a link on a page that fired off this .exe didn't work anymore. I recently started as the web developer and had never worked with that particular web page or .exe until I got compliants that it wasn't working. I wish I could provide more background or information but that is all I was unfortunately left with.

The code in the ASP script was:

<a href='\\server\folder\myjob.exe'>View Report</a>

and this fired off the application on the client PC and everything worked fine.

I have taken off the link to the intranet site because it wasn't working and have told our users to use the exe from their desktop instead. I guess I was just looking for feedback on why it might not have worked and indications above point me to steer away from something like this for security reasons anyway.