Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

New methods to get the cd-rom letter

Featured Replies

Method 1

Create a file called cdrom.cmd, and put it in the $OEM$ directory of your unattended cd. In cdrom.cmd put:

echo set cdrom=%cd:~0,2%>>%systemdrive%\autoexec.bat

Save the file. Now add:

"cdrom.cmd"

to your cmdlines.txt file.

This method will return your CD-ROM drive as system variable %cdrom% in the format of “X:”

Note: The system variable %cdrom% will not be available until the computer restarts. If you are only doing it for RunOnceEx, it should work just fine.

Method 2

Get setx.exe from your XP cd under “X:\support\tools\support.cab”, and put it in “$OEM\$$\System32” folder. In your cmdlines.txt, add:

"setx cdrom -k HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Setup\SourcePath"

This method will return your CD-ROM drive as system variable %cdrom% in the format of “X:\”

Final note: These methods will only work if you install windows from a CD.

FOR /F "skip=4 tokens=3" %I IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath"') DO (
 SETX CDFullPath "%~I"
 SETX CDDrive "%~dI"
 SETX CDPath "%~pI"
)

found in someone else's post here...long time ago.

  • Author

Oh well zippy, at least the first one is original (I hope) :rolleyes:

edmoncu, that would just be too easy :)

Why do that when just plain %cd% works  :)

His method works on either the hd, or cdrom, where the %CD% only works on the cdrom.

If it is only effective on the cdrom, then you might as well use %~d0 in your script.

Why do that when just plain %cd% works  :rolleyes:

His method works on either the hd, or cdrom, where the %CD% only works on the cdrom.

If it is only effective on the cdrom, then you might as well use %~d0 in your script.

%cd% means current directory!

It will give the path to where ever you call it from.

It is universal.

Please try things before saying it won't work as people browse this forum and take information as fact. :)

Why do that when just plain %cd% works  :rolleyes:

His method works on either the hd, or cdrom, where the %CD% only works on the cdrom.

If it is only effective on the cdrom, then you might as well use %~d0 in your script.

%cd% means current directory!

It will give the path to where ever you call it from.

It is universal.

Please try things before saying it won't work as people browse this forum and take information as fact. :)

So let me get this straight, %CD% gives you the current directory from where you call it. Which means something will have to call this script from the cdrom (cmdlines).

zippy's method can be called from the cdrom (cmdlines), or hd (runonce).

Sure you can put the cmd anywhere you want, but if you are calling it from cmdlines, what is the point of having the cmd on the hd?

If you are going to be calling it from the cdrom, then leave the cmd file on the cdrom, and you can use %~d0. If you want the path, %~dp0.

Also I didn't say it wouldn't work. Just trying to understand your logic.

edmoncu -

So with DetectCD2 I would just add some thing like so to the cmdlines.txt:

[COMMANDS]
"CMD DetectCD2 /C"

Then %cdrom1% and %cdrom2% values would be useable for the likes of runonceEX...so I could then use some thing like:

REG ADD %KEY%\015 /V 1 /D "%CDROM1%\Software\AdobeReader\AR6.msi /qn" /f

Or am I missing some thing?

Also where should it be placed?

$OEM$ or $OEM$\$$\SYSTEM32 hehe or else where?

i use the plain jane method:

for %%i in (C: D: E: F: G: H: I: J: K: L:) do if exist %%i\nLite.log set CDROM=%%i

I use nLite obviously, and don't delete the log file

[bM]Crusher -

Now I'm taking a bit of a stab in the dark here...but I'm guessing that fuctions the same as:

cmdow @ /HID
@echo off
set tagfile=\WIN51

IF EXIST C:%tagfile% SET CDDRIVE=C:
IF EXIST D:%tagfile% SET CDDRIVE=D:
IF EXIST E:%tagfile% SET CDDRIVE=E:
...

In which case I suffer from a issue and thats hdd's (raid) showing up post the execution of that code...which then bumps the cdrom to a different value...but its not reflected in the code.

Tho I do run that code from RunOnceEX.cmd....maybe I should have it placed else where...well thanks for you time thus far...and any working answers are more than welcome. :)

So let me get this straight, %CD% gives you the current directory from where you call it. Which means something will have to call this script from the cdrom (cmdlines).

zippy's method can be called from the cdrom (cmdlines), or hd (runonce).

Sure you can put the cmd anywhere you want, but if you are calling it from cmdlines, what is the point of having the cmd on the hd?

If you are going to be calling it from the cdrom, then leave the cmd file on the cdrom, and you can use %~d0. If you want the path, %~dp0.

Also I didn't say it wouldn't work. Just trying to understand your logic.

Yes you call it from cmdlines but it injects it into the registry at the 13min mark.

So when run once runs (from the hard drive) it has the letter from the cd cause it originally called from cmdlines.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.