Trouble with Process.start in my web application

  • Thread starter Thread starter Nisha
  • Start date Start date
N

Nisha

Hello everyone,

I have a web page which needs to open files of type .pdf (adobe) and
..doc(microsoft word).

I tried something fairly simple and have been having a lot of trouble
getting it to work.
So far just started with PDF as I figured that would be the simpler of the
two. However when that didnt seem to work.. I used a simple txt file.

Here is what I am doing

Imports System.Diagnostic
Imports System.Threading

Dim mprocess as New Process
mprocess.StartInfo.FileName = "C:\temp\readme.txt"

mprocess.Start()

mprocess.WaitForInputIdle()

Thread.Sleep(1000)



What I am expecting is to see my txt file opened up. What actually happens
is..I see notepad.exe as a process in my task manager with username ASPNET
but I do not see my file opened up...

What am I missing????

Any help and sample code in this matter would be appreciated.



Thanks in advance...

...Nisha
 
I guess the following might help:
Run services.msc, right click World Wide Web Publishing Service, on Log
On tab, check "Allow service to interact with desktop".
I have a question:
Is there any reason you should do that?
 
Your trying to start a file on the server, not in your web page. The server
has no concept of a desktop, and has no where to display it.

Imageine if your site was busy and a million people suddenly spawned things
on your desktop - technically thats what your asking to happen.

Regards

John Timney
Microsoft MVP
 
Back
Top