DVD/CD Drive letter

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

Using nLite to create Windows XP Pro SP driver DVD/CD. The reason I change
the drive letters sfter install is I stick to a standard which works best
with the range of hardware (sometimes 1 HDD, other times more) including
various USB devices.
 
Jason said:
Using nLite to create Windows XP Pro SP driver DVD/CD. The reason I change
the drive letters sfter install is I stick to a standard which works best
with the range of hardware (sometimes 1 HDD, other times more) including
various USB devices.

And your question is?
 
Jason said:
How to do this change as part of the nLite install instead of after XP is
installed.

I don't know nLite but the usual way to change a drive letter is via
diskmgmt.msc. If you want to script the process then you can do it in a
batch file by using mountvol.exe to unmount, then remount the CD device with
the desired drive letter.
 
I can use mountvol /d but how do I find the current drive letter (each
computer could have different drives/partitions)? Also how would I remount
it? Once I know the letter I could use:
mountvol %DRIVE% /l >c:\temp\VOL.txt
mountvol %DRIVE% /d
mountvol <c:\temp\VOL.txt L:
Although the last line might not work since there is a variable after the
txt file.
 
Jason said:
I can use mountvol /d but how do I find the current drive letter (each
computer could have different drives/partitions)? Also how would I remount
it? Once I know the letter I could use:
mountvol %DRIVE% /l >c:\temp\VOL.txt
mountvol %DRIVE% /d
mountvol <c:\temp\VOL.txt L:
Although the last line might not work since there is a variable after the
txt file.

You can use this batch file. To make it really robust you should check if
the chosen drive letter is available.

@echo off
set NewLetter=F:
for /F %%a in ('mountvol ^| find ":\"') do call :Sub %%a
echo Changing the CD drive letter from %OldLetter% to %NewLetter%
mountvol %OldLetter% /d
mountvol %NewLetter% %ID%
mountvol
goto :eof

:Sub
fsutil fsinfo drivetype %1 | find /i "CD" || goto :eof
set OldLetter=%1
for /F %%a in ('mountvol') do (
if %1==%%a goto :eof
set ID=%%a
)
 
Thanks,
I've created the batch file but not sure it will run. For the command to
run, should that be \path\filename.bat?
 
Jason said:
Thanks,
I've created the batch file but not sure it will run. For the command to
run, should that be \path\filename.bat?

Yes, all batch files must have a .bat or a .cmd extension.
 
Jason said:
I know about bat. I was asking about using the directory and no drive
letter.
Thanks,
J.

Sorry, you've left me behind. Please rephrase/expand your question.
 
If the batch file is called as %CDDRIVE%:\path\filename.bat after windows is
installed then do I just use \path\filename.bat as the filename in nLite
runonce commands?
 
I've been following this thread with some interest and I'm amused about your
most recent reply/clarification. As we say around here, it is about as clear
as mud. Pegasus would have to be a real smart cookie to understand what you
are talking about. How about explaining the whole issue to a friend, then
asking him to translate it into a comprehensible question?
 
This is clear!
Monitor said:
I've been following this thread with some interest and I'm amused about
your
most recent reply/clarification. As we say around here, it is about as
clear
as mud. Pegasus would have to be a real smart cookie to understand what
you
are talking about. How about explaining the whole issue to a friend, then
asking him to translate it into a comprehensible question?
 
Jason said:
If the batch file is called as %CDDRIVE%:\path\filename.bat after windows
is installed then do I just use \path\filename.bat as the filename in
nLite runonce commands?

Sorry, I cannot understand what you mean.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top