I understand it is not recommended to assume that drive letter C: is reserved for the OS volume. So is there a straightforward way to answer the question - what volume does 开发者_Go百科the Windows OS reside on?. Volume can be a drive letter or a volume GUID or any other way that volumes are identified. Note that I am looking for the OS partition which is not the same as the System partition.
GetWindowsDirectory() and then break up the path with _splitpath.
Edit: Changed GetSystemDirectory with GetWindowsDirectory. In practice results should be the same.
精彩评论