Click here to Skip to main content
13,291,748 members (59,087 online)
Rate this:
Please Sign up or sign in to vote.
See more:
What method can judge system is diskless system
Please give me some Suggestions
Posted 6-Jan-13 22:01pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

I believe that this task would be OS specific and so would defer from OS to OS.

In Windows, you can use one of the following methods -

Use QueryDosDevice to list all the device names in the system.
The device names listed would be something like \Device\HarddiskVolume1, \Device\Floppy0 etc.
From this list you can check that if there is no Harddiskxxx, it means there is no hard disk in the system.

Use CreateFile to open physical drives like \\.\PhysicalDrive0, \\.\PhysicalDrive1 etc.
Check the return value to ensure that none of the disks exists.
SajeeshCheviry 7-Jan-13 3:29am
good answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.171207.1 | Last Updated 7 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100