@Yzöwl
As to WMIC, I just typed in that command at my command line, and Windows had to install it first. I'm not too fond of that. Also, this technique goes back to the issue of having multiple optical drives. But in this case the issue would be if the user has media in more than one optical drive, two drive letters will be returned by WMIC. So you are back to looking for check files again to verify which media is the correct one. this is less risky than the For-In-Do Check file or label technique, but there is no such risks when using the Set CDROM=%~d0 technique (which to me appears faster as well).
Yzöwl, on Sep 23 2005, 05:40 AM, said:
DarkShadows, on Sep 23 2005, 04:38 AM, said:
7. Call MapCD (sets %CDROM% Globally for other CmdLines.txt scripts)
<{POST_SNAPBACK}>I may be wrong here but unless you set a permanent environment variable, due to the way each child cmd process automatically cleans-up on closing, your variable will only last until that specific window is closed.
<{POST_SNAPBACK}>
You are correct, variables set in any script launched from CmdLines.txt do not live past the life of that script. MapCD
must be called from the top of each script launched from CmdLines.txt, as %CDROM% will destroyed after each script called from CmdLines.txt ends.
My personal process was actually
calling MakeMapCD.cmd from my first CmdLines.txt script (not CmdLines.txt as I've prescribed here for everyone). This is why MakeMapCD v1.1 contained a call to MapCD). When I posted MakeMapCD.cmd v1.1 for others to use, I should've cleaned the Call MapCD.cmd out of it. So all along I've been discussing with you on the basis of what my personal process was doing, not what the posted version of it
should be doing. Sorry for the confusion!

I've since modified my
own process to be the same as the one I've posted. And now, I agree that Setlocal
can go at the top of MakeMapCD.cmd. (Life is so much more clear when talking apples-to-apples).
@Everyone
I've updated MakeMapCD.zip download accordingly on the first post in thread (now v1.1.1). The changes I've made are mostly organizational and documentation.
The original version I posted (v1.1) will still work just fine, so long as MapCD is called from the top of any of your scripts (which was my recommendation all along).
The Zip includes a sample CmdLines.txt and SampleScript.cmd that I just tested on Virtual PC. SampleScript simply stops at T-12 and Echo's the %CDROM% value to the screen.
[Edit] Here's a link[/Edit]
MakeMapCD.zip
This post has been edited by DarkShadows: 23 September 2005 - 03:22 PM