Process.Start()

R

Robert Megee

I can't get Process.Start() to work from a Web application.
Is this because of the security settings in the browser?
Since this is for a private network, security isn't an issue.
Anyone know how to make this work or is there another way?

I've tried:

Process proc = new Process();
proc.StartInfo.Startfile = "c:\\winnt\\notepad.exe";
proc.Start();

and the basic way:

Process.Start("c:\\winnt\\notepad.exe");

It will complain if it can't find the file and dosn't give
any error or result if it can.

any clues?

Thanks,

Robert Megee
 
S

szeying.tan

since asp.net is a service account, it cannot start any UI windows.
even if you gave it all the rights in the world.

if you want to load a txt document, just push a text document through
the browser window and it should load whatever application is
associated on the user's machine to the .txt extension.. which should
usually be, notepad.exe
 
A

Alvin Bruney [ASP.NET MVP]

since asp.net is a service account, it cannot start any UI windows.
even if you gave it all the rights in the world.
That's not true at all. The code will work just fine on a development
machine and promptly fail on a webserver because a server has no user
interface piece. You should only try to run applications that have no user
interface pieces ideally. If you need to spark notepad on a client desktop,
you will need to build an activeX application - its a permissions thang!
--
Regards,
Alvin Bruney

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
------------------------------------------------------------
 
S

szeying.tan

sorry, i guess i was overexaggerating when i said "all the rights in
the world.."
you could change the asp.net user to run as a system account... but it
really goes against every bone in my body (there i go again..
overexaggerating ;))... the browser complains when you pop up an
activeX window too, doesn't it..?
 
R

Robert Megee

I actually tried this with several different programs including a bat
file and an x-window emulator (exceed). They all failed.
I'll take a look at how to create an activeX app.
Since this is a on a private network with no outside connection,
security isn't really an issue so I've got some freedom there.

Thanks for the help.

Robert
 
R

Robert Megee

I understand having qualms over security. I've been in the unix world
for quite a while and realize the danger of running under root.
This is running on a private network with no outside connection so at
least I've got a bit of freedom to experiment.

Thanks for the info.

Robert
 
S

Sean Hederman

Robert Megee said:
I actually tried this with several different programs including a bat
file and an x-window emulator (exceed). They all failed.
I'll take a look at how to create an activeX app.
Since this is a on a private network with no outside connection,
security isn't really an issue

<twitch> <twitch>

And is there the slightest possibility that it will ever be deployed on a
network that does have an outside connection? Have you also considered that
many hacking attacks are performed by disgruntled employees?
 
S

Stephan Steiner

Just wondering, are you trying to start Notepad on the server (not quite
sure what that would do for you) or on the PC from where the connection to
the server is made?

Obviously, the server cannot start an application running on the client
machine.. all you get back from the server is HTML after all. And running
notepad on the client box kinda sounds like an IE exploit ;)

And if you want to start notepad on the server anyway, you need to change
the security permissions of the ASP.NET account (not a great idea, but it
works.. I'm running Excel on a webserver... it's a security nightmare I
know)

Regards
Stephan
 
R

Robert Megee

I was just using notepad because I knew everyone would have a copy of
that. What I started out trying to run on the client was an X-window
emulator called exceed. I've got an ancient Oracle forms data
collection form that I can launch from a web page is exceed is
running. One of my co-workers needs it for a portal that he's
created. I will eventually re-write it like the other ancient
applications it's just not scheduled for a re-write at present. Too
many other things to do.

Robert
 

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

Top