idanlerer Posted June 28, 2007 Share Posted June 28, 2007 Hi,Is there any option in windows pe to get the drive letter of the CD-ROM ?I would like to create batch file that need access to the CD-ROM but I don't know what is the CD-ROM drive letter (it's not the X since I not place in the mount folder) Link to comment Share on other sites More sharing options...
jaclaz Posted June 28, 2007 Share Posted June 28, 2007 Usually a small batch file checkong the existance of a "tag file" (i.e. a file that you know is ONLY on the CD) is used, an example is here:http://www.msfn.org/board/index.php?showtopic=38739A more elaborate example of batch can be found here:http://www.robvanderwoude.com/amb_cdrom.html(that can detect a CD ROM even if no media is in it)And here is a .vbs example:http://www.robvanderwoude.com/files/cdrom_vbs.txtThough I did not understand:(it's not the X since I not place in the mount folder)could you please better explain the above.jaclaz Link to comment Share on other sites More sharing options...
IcemanND Posted June 28, 2007 Share Posted June 28, 2007 not sure if it works in PE or not noone has ever tried to my knowledge. http://www.msfn.org/board/index.php?showtopic=38913 Link to comment Share on other sites More sharing options...
zorphnog Posted June 28, 2007 Share Posted June 28, 2007 Here is what I've come up with for my ghost restore disks that use a WinPE boot. I have a HTA menu solution so its in vbscript.'GlobalsDim objShell, objFso, cdromSet objShell = CreateObject("WScript.Shell")Set objFso = CreateObject("Scripting.FileSystemObject")Sub findCD Dim collSettings, objItem, lword'determine cd-rom drive letter objShell.Run "%comspec% /c diskpart /s X:\Windows\system32\probeDrives.txt",0,true Set collSettings = objFso.Drives For Each objItem in collSettings If objItem.DriveType = 4 Then lword = objItem.DriveLetter If objFso.FileExists(lword & ":\sources\boot.wim") Then cdrom = lword & ":" Exit For End If End If Next'check whether cdrom was set If cdrom = "" Then MsgBox "Could not determine CD-ROM drive letter",16,"Error" End IfEnd SubprobeDrives.txt:rescanexitI've found that if you have an external CD/DVD drive it doesn't always pick up the drive, so the probeDrives diskpart script ensures that all drives are accounted for before you look for the drive. boot.wim is the jellybean I look for on the drive since I always use a PE boot. Link to comment Share on other sites More sharing options...
green_tee Posted October 13, 2007 Share Posted October 13, 2007 Hello,First of all, I just wanted to say thanks to you guys for putting forth the time and effort to write and post your tools!I am looking to use the newer WinPE 2.0 for image deployment, and this is exactly the issue I need help to tackle. I came across this, and the DetectDrive thread, but I haven't been able to get either to work within this environment. I have the Scripting package installed in PE, but nothing else (do I need something else?)...The DetectDrive program seems to do nothing, as in, the help file won't even pull up and the script doesn't seem to do anything either.Opening a new cmd window to run Set gives no new variable in either case. I am not necessarily new to batch files/command prompt/scripting, but I am not an expert either.Can you guys offer any further suggestions?Thanks,David Link to comment Share on other sites More sharing options...
IcemanND Posted October 13, 2007 Share Posted October 13, 2007 I don't have it here in front of me but in a recent Technet article they said under certain circumstances you need to install an additional component to your PE build. It seems to me it was MDAC but it could have been XML. Try adding those, or all of them and see what happens. Link to comment Share on other sites More sharing options...
zorphnog Posted October 15, 2007 Share Posted October 15, 2007 I add WMI, HTA, Scripting and XML to my image, but you shouldn't need HTA or WMI so it may just be the XML package. Doesn't make since to me but give it a try. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now