Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: diskpart script hangs at "select disk"

03 Oct 2012   #1
robirvin

Windows 7 64bit
 
 
diskpart script hangs at "select disk"

Hi. most of the machines I deploy have two disks. I am using a diskpart script to clean and format the disks/partitions. Well, I need to be able to deploy onto a machine that only has one disk. Since the "select" command doesn't have the "noerr" option the script fails on the single disk machine. Is there a way I can modify the script so that it will work on both configurations? Here is my simple script:

select volume 0
remove noerr
select disk 1
clean
select disk 0
clean
select disk 1
create partition primary
select partition 1
format FS=NTFS label=Voyager-1.0 quick
active
assign letter=c
select disk 0
create partition primary
select partition 1
format fs=ntfs label=DATA quick
assign letter=d
exit

Thanks in advance,
Rob


My System SpecsSystem Spec
.

03 Oct 2012   #2
swordson

Windows 7 Professional 64bit
 
 

Am I right to assume that you are trying to partition a single disk into 2 partitions? And for this single hd machine, are you running diskpart from a bootable media?
My System SpecsSystem Spec
03 Oct 2012   #3
robirvin

Windows 7 64bit
 
 

Thanks for the quick reply. To answer your question...
The script I posted basically partitions two disks with one partition each. The first disk is the system drive (c) and the second disk is a data drive.

On the laptop there will only be one disk and it needs to be a single partiton (c).

The problem is when my script tries to select the second disk and there isn't one on the laptop the script will hang. If I could use "noerr" on the select command I think it would be fine. I am PXE booting into winpe and the script is being called from the bootstrap.ini file. I think there needs to be some logic in the script that detects the number of disks first, but unfortunately I'm not a very good scripter and am not sure how to approach it. I was hoping there was a simple way to add the logic into the batch file posted rather than try and write a .vbs script. I'm decent with powershell but winpe doesn't have it and adding it is an extra step in addition to writing the actual script. I hope this makes sense. Thanks again.
My System SpecsSystem Spec
.


Reply

 diskpart script hangs at "select disk"




Thread Tools





Similar help and support threads
Thread Forum
Assigning "domain user" to "local admin" on select PCs
I'd like to assign a few select "domain users" to be local admin over their test machines which log into a domain. The test machines are Windows 7 64bit and the domain is Win2k8 R2. I have been searching around for the best way to do it but I've come up short on my search. Anyone know off the...
Network & Sharing
HDD shows in "Device Manager" but not in "DiskPart"or" Disk Management
Hi Guys, any ideas how to access my external hard drive device manager can see it but it does not appear in disc management. I use this HDD perfectly in my car HDD player. But when I try to connect it to my Laptop, it does not show up in disk management. Please check the attached screen...
Hardware & Devices
Diskpart "Clean All" Hangs
Hello everyone. I've recently received a Lenovo H405 series computer that is completely wiped and only can run BIOS. I have all of the repair disks, the Windows 7 installation disk, along with a disk to install all of the drivers. I've been unable to fully install Windows 7 thus far after trying...
Installation & Setup
diskpart's "clean all" hangs, no signs of HD activity
I am following the instructions at http://www.sevenforums.com/tutorials/52129-disk-clean-clean-all-diskpart-command.html to erase my entire HD before sending my laptop somewhere. In particular, I am issuing the diskpart command from a "command prompt at boot". I only have one HD on the laptop,...
Performance & Maintenance
"Select Proper Boot Device" now "NTLDR is missing"
Computer Specs: CPU: I5-2400 MB: Asus Pz868 Ram: Corsair 8GB Vengeance LP Using on board VIdeo For now Maxtor HD Sata WD Raptor Sata HP Lightscribe DVD-r Drive Sata Problem I was having once I completed my new build with old system parts was as listed in title. It started out as select...
BSOD Help and Support
Disk Management hangs at "Loading disk configuration information"
When trying to view my disks in Computer Management>Disk Management, I get "Connecting to Virtual Disk Service" for several minutes, then "Loading disk configuration information" nearly forever. After about 20 minutes, some information appears, but I can't scroll the window to see all the data. ...
Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:54.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App