开发者

Programmatic way to find the Windows OS volume?

开发者 https://www.devze.com 2023-02-11 13:31 出处:网络
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

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消