File not found when I try to launch and EXE from a webpage

M

Microsoft

I'm working on you first asp.net project and its just a conversion of an
existing vb.net project I have.

I am trying to have the user push a button and execute a program from a
share on the network.

I get "the system cannot find the file specified", but the file is there and
works fine from a gui..

Here is the sun that is not working

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim CompName
Dim program As New Process

program.StartInfo.FileName = "\\sms13\remote$\remote.exe"

program.StartInfo.Arguments = " 2 " & " \\" & CompName & "\"

program.Start()

Thanks for any help!
 
R

Roger Helliwell

I get "the system cannot find the file specified", but the file is there and
works fine from a gui..

Here is the sun that is not working

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Dim CompName
Dim program As New Process

program.StartInfo.FileName = "\\sms13\remote$\remote.exe"

program.StartInfo.Arguments = " 2 " & " \\" & CompName & "\"

program.Start()

Thanks for any help!

Try setting the 'Filename' property with a fully qualified filename.
(By using Server.MapPath() for example). I suspect it is looking in
your Windows directory to find the file.

Roger
 
M

Microsoft

Thanks for the response..

The file is located on a server that is remote to the Webserver and I want
the file to launch on the client. Its a small app.
I'm not sure how server.mappath would help.
 
R

Roger Helliwell

Thanks for the response..

The file is located on a server that is remote to the Webserver and I want
the file to launch on the client. Its a small app.
I'm not sure how server.mappath would help.
news:[email protected]...

You want the file to be executed on the client? The way you have
things set up is definitely not the way to go if that's the case.

Executing .exe's on a client's machine is a huge problem. (Imagine the
security risk!) You'll need to use ActiveX or something similar to do
what you're doing.

Roger
 
M

Microsoft

Oh... I moved the file to the server and changed the path and now it
launches fine, but as you said it runs on the server
This is for an internal site of our company. The site is in the trusted
sites of the browsers that are using the site, so security should not be an
issue. There's not a VB command I can use?
 
R

Roger Helliwell

Oh... I moved the file to the server and changed the path and now it
launches fine, but as you said it runs on the server
This is for an internal site of our company. The site is in the trusted
sites of the browsers that are using the site, so security should not be an
issue. There's not a VB command I can use?

No. To run an executable on a client's machine. You would first have
to load it onto the client's machine. Then execute it.

However, if the executable is .NET (managed) code, you could have a
link that points to the exe. Something like:

<a href="http://secureinternaldomain.com/myapp.exe">Run this App</a>

This is how a "Smart Client" application would run on a client
machine. There is lots of info on msdn.com if this is what you're
after.

Roger
 
M

Microsoft

Its actually a Piece of SMS2003. The remote Gui. copies of it are located
on the client and on our network in general.. I can point to either..

Its not .net managed code, but I could make a virtual directory point to it.
Other than executing the client I have an example webpage from someone who
does exactly what I want to do, but its in asp, not asp.net so unless I can
figure out how to call his page and send values to it, I would have to
rewrite my entire web app using asp.

The Exe I want to execute is in exactly the same place on every client, so I
hope that makes it easier.

Can you point me to where on MSDN they discuss launching apps on the client.
I can't find it.. Thank you for all the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top