Home All Groups Group Topic Archive Search About

accessing CD/DVD-ROM without drive letters

Author
23 Jan 2006 6:31 PM
Jedi10180
I am trying to open a pdf file from a CD in my VB app. I'm using
System.Diagnositcs.Process.Start to open the file, but I can't use
d:\file.pdf because not all cd-rom drives are named d:\. How can I get around
this?

Author
23 Jan 2006 6:57 PM
Herfried K. Wagner [MVP]
"Jedi10180" <Jedi10***@discussions.microsoft.com> schrieb:
>I am trying to open a pdf file from a CD in my VB app. I'm using
> System.Diagnositcs.Process.Start to open the file, but I can't use
> d:\file.pdf because not all cd-rom drives are named d:\. How can I get
> around
> this?

Well, what would you do if there is more than one Cd drive available on the
system?

Opening and closing the CD-ROM drive
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=setcddoorstatus&lang=en>

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
23 Jan 2006 8:31 PM
Jedi10180
Well, if there is someway to use a relative path so that the application just
looks on the CD that called it, it wouldn't matter how many CD drives were on
the machine. That's the functionality I'm looking for.

Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "Jedi10180" <Jedi10***@discussions.microsoft.com> schrieb:
> >I am trying to open a pdf file from a CD in my VB app. I'm using
> > System.Diagnositcs.Process.Start to open the file, but I can't use
> > d:\file.pdf because not all cd-rom drives are named d:\. How can I get
> > around
> > this?
>
> Well, what would you do if there is more than one Cd drive available on the
> system?
>
> Opening and closing the CD-ROM drive
> <URL:http://dotnet.mvps.org/dotnet/faqs/?id=setcddoorstatus&lang=en>
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>
Author
23 Jan 2006 8:43 PM
Herfried K. Wagner [MVP]
"Jedi10180" <Jedi10***@discussions.microsoft.com> schrieb:
> Well, if there is someway to use a relative path so that the application
> just
> looks on the CD that called it, it wouldn't matter how many CD drives were
> on
> the machine. That's the functionality I'm looking for.

'Application.StartupPath' + 'System.IO.Path.*'.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
23 Jan 2006 10:55 PM
Jedi10180
I have tried Application.StartupPath, but since the application has to
install the .Net framework (I'm assuming this is the reason),
Application.StartupPath returns a temp directory on the local hard drive. So
using that in the System.Diagnostic.Process.Start call doesn't work because
that's obviously not where my pdfs from the CD are stored. The more I think
about this, the less I think that there might be a way around it. I hope I'm
wrong - any other ideas?

Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "Jedi10180" <Jedi10***@discussions.microsoft.com> schrieb:
> > Well, if there is someway to use a relative path so that the application
> > just
> > looks on the CD that called it, it wouldn't matter how many CD drives were
> > on
> > the machine. That's the functionality I'm looking for.
>
> 'Application.StartupPath' + 'System.IO.Path.*'.
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>