Using COM Class
Posted: September 13th, 2015, 10:16 pm
Hello,
I've been trying to access WMI data on my computer using PHP. My scripts works fine until being compiled by Phalanger; which returns following error message upon running:
"Error: Class 'COM' not found in myfile.php, on line x column y"
This is the method I've been using WMI access:
$obj = new COM ('winmgmts://localhost/root/CIMV2');
$fso = new COM ("Scripting.FileSystemObject");
$ddrive = $obj->ExecQuery("Select * from Win32_DiskDrive");
foreach ( $ddrive as $wmi_DiskDrive ) {
$sys = $wmi_DiskDrive->SystemName;
}
How can I use this method to access WMI after this code is compiled?
Thank you
I've been trying to access WMI data on my computer using PHP. My scripts works fine until being compiled by Phalanger; which returns following error message upon running:
"Error: Class 'COM' not found in myfile.php, on line x column y"
This is the method I've been using WMI access:
$obj = new COM ('winmgmts://localhost/root/CIMV2');
$fso = new COM ("Scripting.FileSystemObject");
$ddrive = $obj->ExecQuery("Select * from Win32_DiskDrive");
foreach ( $ddrive as $wmi_DiskDrive ) {
$sys = $wmi_DiskDrive->SystemName;
}
How can I use this method to access WMI after this code is compiled?
Thank you