Solved

starting an exe program using response.redirect in ASP

Posted on 2006-11-07
12
640 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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
 
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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

707 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