Click here to Skip to main content
15,886,518 members

Comments by iismoove (Top 25 by date)

iismoove 10-Apr-13 20:25pm View    
Ok, I figured it out and I just wanted to let you know how I did it and get your input. I posted my solution to it.
1. I found out DISKPART puts the drives on the machine in the following order: dvd/cd-rom, local disks, then removable drives.
2. I got the total number of drives on the machine(which matches DISKPART), and split them between the 3 types.
3. I took the total drives and subtracted out the dvd/cd-rom drives and added 1 to get the first local disk “Volume” number.
4. I looped through “DelExistingPartitions” function as many times as there are local disks, adding 1 to the “Volume” number each time.
iismoove 4-Apr-13 10:23am View    
I'll figure it out eventually, but for now, I will just use the string manipulation until I find a better solution. I will take a look and try your second solution and let you know.
iismoove 4-Apr-13 10:06am View    
Are you always on here? LOL. It seems like no matter when I post, you post right back.
iismoove 4-Apr-13 10:04am View    
I see what you are saying. It was my fault. I should have explained what I was trying to do. At the time I asked the question, I didn't think it was relevant to explain what I was trying to accomplish other than trying to find the volume number (or whatever it is). I will try to keep that in mind for future, and explain in a little more detail about the scope first, then my issue.

The only reason I use the terms “Volume” and “0” and such, is because I just want to try and explain where the number is in my DISKPART snippet that I am looking for. It’s for reference ONLY. DISKPART numbers each Disk/Partition on your machine. I want to know how DISKPART gets those numbers. Because I want to make those numbers a variable to run DISKPART in a program to delete those Disks/Partitions.

Now with your compare, you are right, the order does not matter. But, how do then find out which disk/partition/volume matches?

iismoove 4-Apr-13 9:51am View    
I will give it a try and let you know. It may not be until later today, but I will give it a whirl.