Start Free Trial
Come for the solution, stay for everything else.
Start Free Trial
Diskpart script help
I have a txt file that has this
select disk 0
create partition primary size=100
select partition 1
format quick fs=ntfs label="System"
create partition primary
select partition 2
format quick fs=ntfs label="Windows"
And to run this as a script
i use diskpart.exe /s WipeC.txt
BUT i am booting of a usb with a label name "images"
This has only happen one time but my script wiped my usb because it was disk 0.
Is there a way to check if disk 0 is label "images" if it is DON'T wipe it.
8/22/2022 - Mon
A "DISK" does not have a label, a partition has a label. so that is no use and diskpart does not know about labels.
You could run a diskpart script that just listed out the DISKs to a text file and then parse the textfile to decide what disk to wipe.
ASKER CERTIFIED SOLUTION
Log in or sign up to see answer
Become an EE member today
7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
I have not learn PowerShell yet. it's on my bucket list but at this time can i output the diskpart info to a text file then use vbs to find out id Disk 0 is label name "images" if so DON'T Wipe it and stop.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
Plans and Pricing
Certified Expert Program
© 1996-2022 Experts Exchange, LLC. All rights reserved. Covered by US Patent