Jump to content

Recommended Posts

Posted

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.


Posted

There is %CDROM% which would include DVD drives also. Or do you have a CD rom and a DVD drive, and want to pick the DVD only? Like something that will differentiate between them?

Posted

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).

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

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