Jump to content

Problem detecting CDROM drive


Recommended Posts

On my machine I have a 4 in 1 cardreader that exposes the 4 cards as drives with removable media that is always connected to my machine via USB.

When trying to determine which drive is my CDROM drive with something like

FOR %%i in (c d e f g h i j k l m n o p q r s t u v w x y z) do if exist "%%i:%tagfile%" set CDDRIVE=%%i:

I always get error multiple messages (3 or 4) popping up stating something like "No disc in drive".

This happens at various stages during the unattended install.

e.g. this code is used in the preset.cmd file of Bâshrat the Sneaky's driverpacks

But it also happens during [GUIRUNONCE] etc.

I understand why this happens (no discs in the removable media drives) but it is very annoying as it effectiely breaks the unattended install.

Only solution I have found so far as to stop the search at the letter f or so.

Any other suggestions to avoid these popups?

Link to comment
Share on other sites


The "No Disk In Drive" message is just one of many drawbacks of looping through all possible drive letters. In almost all cases that I have seen of people using this method, what the user is really trying to do is simply find the CD Drive from which Windows Installation was done. When this is the information I need (as the Install CD is almost always there where the installation was done ... ), I simply query the registry for the value of the SourcePath, get the drive letter, and asign the varible INSTALLCD with that value. In other words ...

FOR /F "TOKENS=3" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" ^| FINDSTR "SourcePath"') DO SET INSTALLCD=%%~dI

Works for me ...

Link to comment
Share on other sites

  • 1 year later...

Sorry for replying on an old topic , but this was the only one that suits my question. :blushing:

But how do i use this with WPI?

When i have a cardreader atached,the setup is messed up, and it says no disc in drive.

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