Jump to content

ID the CDROM drive


whterbtobj

Recommended Posts

I have a WinPE Image that runs on ramdisk.

I want to run my own shell. Here is what my Winpeshl.ini looks like

Winpeshl.ini

==============

[LaunchApp]

AppPath = D:\myShell.exe

I don't want to hard code the"D:\"

Can I run a script and set %CDROM% as an environment variable and be able to run

%CDROM%\myShell.exe in Winpeshl.ini?

Anyone out there have a solution?

Link to comment
Share on other sites


I've posted this several times before, but I would recommend assigning a specific letter to the CD drive (I use K:) and just go from there.

@echo off
echo list volume > X:\ListCD.txt
FOR /F "tokens=2,4" %%i IN ('diskpart /s X:\ListCD.txt') DO @IF /I %%j == CD_ROM SET CDROMVOL=%%i
IF DEFINED CDROMVOL echo select volume %CDROMVOL% > X:\ChangeCD.txt
IF DEFINED CDROMVOL echo assign letter=K: >> X:\ChangeCD.txt
IF DEFINED CDROMVOL diskpart /s X:\ChangeCD.txt

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