mrucker64
Posts: 4
Score: 0 Joined: 6/18/2008 Status: offline
|
I took this a bit further and looked at an old script I was working on that was foiled by this very problem. Frankly I haven't gotten back to it, but I'll show you the beginning.
@echo off
echo * Diskpart now configuring the local HDD. Sure hope you didn't want anything off of it =)
echo ---
echo select disk 0 > %temp%\dp.txt
echo clean >> %temp%\dp.txt
echo create partition primary >> %temp%\dp.txt
diskpart /s %temp%\dp.txt
if NOT %errorlevel% == 0 goto _error_creating_partition
echo select disk 0 > %temp%\dp.txt
The idea is that when I'm ready, I just: diskpart /s %temp%\dp.txt which runs diskpart with an autocreated script called "dp.txt". The next step, which I'll post if I get around to it ^_^, is to perhaps use diskpart with a one line script of "list disk" and using either Windows PE's find.exe or perhaps awk (which means I need to add it to the PE disk, etc...) to find an active hard drive, and its disk number. Certainly one way in which this can fail is if you have multiple hard drives in the system, but optical devices seem to show up differently. On XP here I have two hard drives and two optical, and the command: diskpart /s listdisk.txt | find /i "Online" begets: Disk 0 Online 74 GB 0 B Disk 1 Online 75 GB 0 B which doesn't show me the optical. Note that in the original problem description you mentioned using WinPE 2.0, which is Vista, no? =) Likely there is a difference in the two versions of Diskpart. -mr
|