Jump to content

Detecting DVD Drive


Recommended Posts

Is it possible to detect witch drive letter the DVD Drive uses..

eg. The envirement variable for the system drive is %systemdrive%. Is there a variable for the DVD Drive or a great script that can find it.

Link to comment
Share on other sites


You need to create an environment variable for the DVD drive. This command script works well for detecting your drive, based on what file is on the DVD disc itself:

IF EXIST D:\somefile.txt set CDROM=D:
IF EXIST E:\somefile.txt set CDROM=E:
IF EXIST F:\somefile.txt set CDROM=F:
IF EXIST G:\somefile.txt set CDROM=G:
IF EXIST H:\somefile.txt set CDROM=H:
IF EXIST I:\somefile.txt set CDROM=I:
IF EXIST J:\somefile.txt set CDROM=J:

"CDROM" can be changed to any variable you want, like "DVDROM" so that it becomes set as %DVDROM% instead (The environment variable only works in the current session. When the command prompt window is closed the %DVDROM% variable is gone).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...