Solved

starting an exe program using response.redirect in ASP

Posted on 2006-11-07
12
615 Views
Last Modified: 2008-03-06
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.
0
Comment
Question by:samic400
  • 3
  • 2
  • 2
  • +3
12 Comments
 
LVL 14

Expert Comment

by:B_Dorsey
ID: 17891556
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
0
 
LVL 18

Accepted Solution

by:
Morcalavin earned 175 total points
ID: 17891662
Are you wanting to start an .exe job on the clients pc, or on the server?
0
 
LVL 13

Author Comment

by:samic400
ID: 17891675
on the client machine.
0
 
LVL 18

Expert Comment

by:Morcalavin
ID: 17891809
This is only possible via IE using an active-x object and javascript.

Take a look at the question below to find a solution:
http://www.experts-exchange.com/Web/Web_Languages/HTML/Q_22036539.html
0
 
LVL 25

Assisted Solution

by:kevp75
kevp75 earned 175 total points
ID: 17892443
@samic

even if you can get this to work via an active-x object, ask youself this question.  I go to site A, site A prompts that it wants me to use this active-x object that is going to run format.exe on my machine.
Would you really want to run that program if you were prompted like that?

Now, the question to you is, could myjob.exe be something that may be accomplished via script?
0
 
LVL 13

Author Comment

by:samic400
ID: 17892575
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.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 25

Expert Comment

by:kevp75
ID: 17892811
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...
0
 
LVL 6

Assisted Solution

by:gete
gete earned 75 total points
ID: 17895482
> on the client machine.

I'm not sure if this is what you want:

<a href="C:\WINDOWS\notepad.exe">Open Notepad</a>

Note: IE will give a Run or Save dialog, then a security warning.
0
 
LVL 16

Assisted Solution

by:ThinkPaper
ThinkPaper earned 75 total points
ID: 17907378
>>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.

response.redirect is just that - a redirect of a URL
so if your domain was mysite.com and if you did something like:
response.redirect("mypage.asp")
it would go to http://mysite.com/mypage.asp
that's why it's attaching it in the front.

I'd question if it really worked before...

I agree with Morcalavin and Kev - you really don't want to use exe in this case.. Huge security issue..

Gete - that's not exactly what he's looking for. Notepad is (typically) already installed and available on your local machine. So when you run that you run your own version of Notepad on your machine. He is trying to have the user access an application the user doesn't have installed - it is available on the server itself.
0
 
LVL 6

Expert Comment

by:gete
ID: 17911083
@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 :)
0
 
LVL 16

Expert Comment

by:ThinkPaper
ID: 17933264
gete: ah. another possiblity i haven't thought of. =)
0
 
LVL 13

Author Comment

by:samic400
ID: 17937504
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.



0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now