Paul Schwotzer Posted October 24, 2008 Posted October 24, 2008 Background: I am using MDT to create an initial Vista "master" image. Once configured I save it as a .wim using imagex.Goal: I want to use a (widely documented) WinPE media (DVD or UFD) to programmatically: 1) format the hard drive into C: and D: partitions using diskpart 2) use imagex to apply the previously captured image to the freshly formatted C: driveProblem: When the WinPE media boots I do get an X: drive. But I also get a C: or D: drive that contains the"ISO" portion of the WinPE media. The media mounts as C: if there is an unformatted hard disk. The media mountsas D: if there is a previously formatted C: drive. EITHER of these drives (C: or D: ) interferes with my diskpart commands.Is there a way to boot WinPE such that the non-X: portion does not interfere with C: and D:?I can use one of the documented WinPE methods (startnet.cmd, unattend.xml, winpeshl.ini) to launch commands.But those commands will fail if C: or D: is already mounted.Perhaps I'm not creating the WinPE media correctly, maybe the mounted C: or D: data is not normal?Thanks, Paul Schwotzer
Jotnar Posted October 27, 2008 Posted October 27, 2008 I think I found this in this forum some time ago. It will change the CD-ROM drive to Z:.echo list volume > X:\ListCD.txtFOR /F "tokens=2,4" %%i IN ('diskpart /s X:\ListCD.txt') DO @IF /I %%j == AdminToolki SET CDROMVOL=%%iIF DEFINED CDROMVOL echo select volume %CDROMVOL% > X:\ChangeCD.txtIF DEFINED CDROMVOL echo assign letter=z: >> X:\ChangeCD.txtIF DEFINED CDROMVOL diskpart /s X:\ChangeCD.txtYou'll need to change "AdminToolki" to whatever the volume name of your disc is keeping in mind that diskpart will only see the first 11 characters. That way both C: and D: should be free. If you place it in a batch file in one of the autorun locations you mentioned it should be automatic.Cheers
Paul Schwotzer Posted October 28, 2008 Author Posted October 28, 2008 This worked! Thanks Jotnar!While a single %i works from a command prompt, I guess the double %%i is necessary inside a batch file.SOLVED.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now