I have a Azure Windows VM where I had renamed the temporary drive D: to letter T: following the official documentation. I enabled custom page filing for one of the drives G:. My goal is to identify through code the accurate temporary drive's label/name.
When I used Win32_PageFileUsage/Win32_PageFileSetting class, I got both T: and G: in responses with no other fields to differentiate the system managed one from custom one. Both drives have pagefile.sys file. Is there a way I can fetch the drive name of only the system managed page file drive? Any C# module or WMI class?
Further: Using Win32_DiskDrive class, the temporary storage and the OS drive have SCSI port as 0. Rest all drives have SCSI port 1. Can I use the SCSI port in DiskDrive class and PageFileUsage class in conjunction to narrow down a temporary drive? Is this a reliable approach?