How do you determine the OS installed on a drive?

engineereeyore

Platinum Member
Jul 23, 2005
2,070
0
0
Aside from the obvious "turn on the drive", does anyone know how you can determine the installed OS on a non-active drive. What I mean by that is, say I have a hard drive in an enclosure connected to my computer. I want to know what OS is installed on that drive. Any ideas?

I know .NET has the OperatingSystem class that provides such information, but I believe it only works on active drives. If I'm wrong about that, please let me know. Other than that, I have no idea how to find this information, other than looking for a specific group of Folders that are native to different installations, but those can be changed.

Suggestions if you have them.
 

hardcandy2

Senior member
Feb 13, 2006
333
0
0
A couple of things you left out of your question.
How is the disk connected?
Does it have power?
 

engineereeyore

Platinum Member
Jul 23, 2005
2,070
0
0
Originally posted by: hardcandy2
A couple of things you left out of your question.
How is the disk connected?
Does it have power?

Drive connected through USB typically, and yes, it would be powered up.
 

engineereeyore

Platinum Member
Jul 23, 2005
2,070
0
0
Originally posted by: sigs3gv
Uhh, see what file system is on there using cfdisk, or PartitionMagic?

Well, that still doesn't narrow it down completely. Even XP or 2000 could be installed on a FAT32 partition. Don't know why you'd do it, but it's still possible.
 

Hakuryu

Member
Jul 27, 2004
31
0
0
I take it you want to know how to determine the OS on a drive that is powered up but not active from a program you are writing?

I dont know any specific functions to do that, but you could read files on the drive like setuplog.txt and parse them for the OS. On XP, the line
07/15/2004 18:07:26,d:\xpsp1\base\...
appears which you can see denotes XP service pack 1.
 

JohnBernstein

Banned
Mar 31, 2006
84
0
0
Hi. On Linux you use the command -- blockid -- or something like that.

But you are on a Windows system -- well -- too bad.
 

JDMnAR1

Lifer
May 12, 2003
11,984
1
0
I am unaware of any functions that can be used to determine the OS of a drive that was not loaded (i.e. system was not booted from that disk). Your only option may be to examine some facet of the file structure and hope that it was a default install (or perhaps look at versions of specific files).
 

bsobel

Moderator Emeritus<br>Elite Member
Dec 9, 2001
13,346
0
0
Your going to have to check for certain files and then read the version info record off them to determine versions (e.g. service packs, etc). No OS functionality to do what your asking.
 

Rilex

Senior member
Sep 18, 2005
447
0
0
Just take the version off of ntoskrnl.exe. That will give you the OS version as well as SP version, if any (as long as you have records of what major/minor versions are out there).
 

engineereeyore

Platinum Member
Jul 23, 2005
2,070
0
0
Sweet. Well thanks for the help. I'll use a couple of those files and assume the user is not an idiot and screwed them up. I would imagine any super-genious that would purposely alter such files wouldn't be using the program anyway.