Process.Start under WinNT4.0

V

Volker Jobst

Hello,

I'm opening a PDF File (e.g. "C:\test.pdf") in my windows forms vb.net
application using the following command:

System.Diagnostics.Process.Start("C:\test.pdf")

On a machine with Win2000 everything works fine.

But on a machine with WinNT4.0 the command gives an error that the file
could not be found. But the file exists, the user has the right to open it
and the Acrobat Reader is installed. I can open the File via a doubleclick.

What is wrong with the Process.Start() function under WinNT4.0, I couldn't
find anything on google or in the MSDN. The MSDN lists WinNT4.0 under the
platforms which support the function.

Can anyone help me?

thanks a lot,
volker jobst
 
G

Gary Dunne

Try launching it as a CLI switch to the reader
System.Diagnostics.Process.Start("C:\Path to Reader\AcroRead32.Exe
C:\test.pdf")

Gary
 
H

Herfried K. Wagner [MVP]

* "Volker Jobst said:
System.Diagnostics.Process.Start("C:\test.pdf")

On a machine with Win2000 everything works fine.

But on a machine with WinNT4.0 the command gives an error that the file
could not be found. But the file exists, the user has the right to open it
and the Acrobat Reader is installed. I can open the File via a doubleclick.

Try this:

\\\
Dim psi As New ProcessStartInfo()
With psi
.FileName = "C:\text.pdf"
.UseShellExecute = True
End With
Process.Start(psi)
///
 
V

Volker Jobst

I found out what is wrong. My exact call looked like this:

System.Diagnostics.Process.Start("""" & strPDFFile & """")

Win2000 can handle those "" which the operating system gets by this call but
WinNT4.0 cannot handle them. I made those masking because I thought it would
be necessary due to spaces in the filename, but it works like this:

System.Diagnostics.Process.Start(strPDFFile)

even if there are spaces in the filename.

Thanks for your replies,
volker jobst
 

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