1.

Solve : Determining partition sizes, and computer models in DOS??

Answer»

I'm working on building a script to use with WinPE to launch GHOST, and one of the PARAMETERS is to set the partition to put the image on to. It's not a problem if you're USED to doing it manually and you know what partition it needs to go onto. The purpose of this script though is for people that may not have the familiarity with it to just put the correct partition in. My question is, is there a either a way to list the partitions on a hard drive for the user to select? Alternatively, a better more "hands off" approach would be for the script to automatically determine the largest partition and just use that one with Ghost.

My second part of this question is, is there an easy way to figure out what model computer you're using from within the script so that possibly I could forgo the user selecting which Ghost image to use? The computers I work with are Dell's and HP's, and they've been coming with Vista so far. This is helpful, because as of right now only the files in the folder containing the images are listed, not any description of them. There is an option to view the readme that has the description of the files, but it requires the user to read it carefully, and is not full proof.

Thanks for the help.You may want to do research on how to read the partition table. There is no easy way to do this. And with Vista there is a new method used to identify the partition layout. The link below is about a problem. It does not apply directly to your project. But the implication is that it may be hard to identify partition size in Vista.

http://support.microsoft.com/kb/919529

Sorry I can't give you more help on this.Quote from: Geek-9pm on March 24, 2010, 10:42:08 PM

And with Vista there is a new method used to identify the partition layout.

No, there isn't. GPT is available in a number of operating systems and even then it's hardly ever used on Vista or 7 anyway. Partition layout is almost exclusively defined with the same MBR that has existed for decades.

Either way, determining Disk/partition size is difficult from a pure DOS environment, simply since DOS doesn't support partition sizes larger then 2GB and most BIOS calls that can be made from DOS are subject to a number of limitations.

I think the best solution would be to get a tool such as aefdisk which can be used to list partitions directly and then somehow process the output from the tool to determine the desired partition, but it isn't going to be easy.Quote from: BC_Programmer on March 24, 2010, 11:03:03 PM
No, there isn't. GPT is available in a number of operating systems and even then it's hardly ever used on Vista or 7 anyway. Partition layout is almost exclusively defined with the same MBR that has existed for decades.

Either way, determining Disk/partition size is difficult from a pure DOS environment, simply since DOS doesn't support partition sizes larger then 2GB and most BIOS calls that can be made from DOS are subject to a number of limitations.

I think the best solution would be to get a tool such as aefdisk which can be used to list partitions directly and then somehow process the output from the tool to determine the desired partition, but it isn't going to be easy.
I don't think the OP is talking about DOS, more LIKELY, he is talking about the command-line interpreter in Windows OSs.Quote from: Helpmeh on March 25, 2010, 06:20:43 AM
I don't think the OP is talking about DOS, more likely, he is talking about the command-line interpreter in Windows OSs.

They should say what they mean then.


Discussion

No Comment Found