You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#1192 added the ability for psutil.disk_partitions() to list mount points on Windows, using the FindFirstVolumeMountPoint, FindNextVolumeMountPoint and FindVolumeMountPointClose functions.
These functions' required permissions aren't well-documented (see FindFirstVolumeMountPoint and FindNextVolumeMountPoint), but experimentally it seems like these two functions only work if the caller has Administrator access on the host. Otherwise, these functions return an OSError 5 (Access is denied), which means they won't appear in the output of psutil.disk_partitions().
For instance, on a Windows Server 2012R2 instance where I added two mount points in the D: drive, I get the following as Administrator:
Summary
Description
#1192 added the ability for
psutil.disk_partitions()
to list mount points on Windows, using theFindFirstVolumeMountPoint
,FindNextVolumeMountPoint
andFindVolumeMountPointClose
functions.These functions' required permissions aren't well-documented (see FindFirstVolumeMountPoint and FindNextVolumeMountPoint), but experimentally it seems like these two functions only work if the caller has Administrator access on the host. Otherwise, these functions return an
OSError 5
(Access is denied
), which means they won't appear in the output ofpsutil.disk_partitions()
.For instance, on a Windows Server 2012R2 instance where I added two mount points in the
D:
drive, I get the following as Administrator:and the following as a non-Administrator user:
Could there be a way for
psutil.disk_partitions()
to be able to list mount points even when the user does not have Administrator rights?The text was updated successfully, but these errors were encountered: