|
8 | 8 | #cs
|
9 | 9 | ===============================================================================================================================
|
10 | 10 | Title ...............: _GetDiskInfoFromWmi (GitHub: https://github.com/htcfreek/AutoIt-Scripts)
|
11 |
| - Version .............: 1.4.1 |
| 11 | + Version .............: 1.4.2 |
12 | 12 | License .............: GNU LGPLv3
|
13 | 13 | AutoIt Version ......: 3.3.14.5+
|
14 | 14 | Language ............: English
|
|
20 | 20 | ===============================================================================================================================
|
21 | 21 |
|
22 | 22 | CHANGELOG:
|
| 23 | + 2022-08-28 (v1.4.2) |
| 24 | + Fixed: Build warnings for non declared variables $sDiskHeader and $sPartitionHeader. (Github#28) |
| 25 | + Added: New Readme.txt for this script. (Github#29) |
| 26 | +
|
23 | 27 | 2021-07-06 (v1.4.1)
|
24 | 28 | Fixed: Code styling
|
25 | 29 |
|
@@ -66,26 +70,27 @@ Global Const $DiskInfoWmi_DiskType_Unknown = "Unknown%"
|
66 | 70 | Func _GetDiskInfoFromWmi(ByRef $aDiskList, ByRef $aPartitionList, $bAddTableHeader = $DiskInfoWmi_TableHeader_Yes, $sFilterDiskType = $DiskInfoWmi_DiskType_All)
|
67 | 71 | ; Name ...............: _GetDiskInfoFromWmi
|
68 | 72 | ; Author .............: htcfreek (Heiko) - https://github.com/htcfreek
|
69 |
| - ; Input parameter ....: ByRef $aDiskList = Array var for list of disks. |
70 |
| - ; ByRef $aPartitionList = Array var for list of partitions. |
| 73 | + ; Input parameter ....: ByRef $aDiskList = Array variable for list of disks returned. |
| 74 | + ; ByRef $aPartitionList = Array variable for list of partitions returned. |
71 | 75 | ; [$bAddTableHeader = $DiskInfoWmi_TableHeader_Yes] = Should array tables have a header row. (Values: 0|1 or $DiskInfoWmi_TableHeader_Yes|$DiskInfoWmi_TableHeader_No)
|
72 |
| - ; [$sFilterDiskType = $DiskInfoWmi_DiskType_All] = Which type of disk should be included in result. (Values: $DiskInfoWmi_DiskType_All|$DiskInfoWmi_DiskType_External|$DiskInfoWmi_DiskType_Removable|$DiskInfoWmi_DiskType_Fixed|$DiskInfoWmi_DiskType_Unknown) |
| 76 | + ; [$sFilterDiskType = $DiskInfoWmi_DiskType_All] = Which type of disk should be included in the result. (Values: $DiskInfoWmi_DiskType_All|$DiskInfoWmi_DiskType_External|$DiskInfoWmi_DiskType_Removable|$DiskInfoWmi_DiskType_Fixed|$DiskInfoWmi_DiskType_Unknown) |
73 | 77 | ; Output parameter ...: none
|
74 | 78 | ; On WMI-Error .......: @error = 1
|
75 | 79 |
|
76 | 80 |
|
77 | 81 | ; Initialize function wide vars
|
78 | 82 | Local $aDisks[0][12]
|
79 | 83 | Local $aPartitions[0][13]
|
| 84 | + |
80 | 85 | Local $iDiskArrayCount = 0 ; Initialize counter to write some disk data later in correct array row.
|
81 | 86 | Local $iPartArrayCount = 0 ; Initialize counter to write partition data later in correct array row.
|
82 | 87 |
|
83 | 88 |
|
84 | 89 | ; Add Array header
|
85 | 90 | If ($bAddTableHeader = 1) Then
|
86 |
| - $sDiskHeader = "DiskNum" & "||" & "DiskDeviceID" & "||" & "DiskManufacturer" & "||" & "DiskModel" & "||" & "DiskInterfaceType" & "||" & "DiskMediaType" & "||" & "DiskSerialNumber" & "||" & "DiskState" & "||" & "DiskSize" & "||" & "DiskInitType" & "||" & "DiskPartitionCount" & "||" & "WindowsRunningOnDisk (SystemDrive)" |
| 91 | + Local $sDiskHeader = "DiskNum" & "||" & "DiskDeviceID" & "||" & "DiskManufacturer" & "||" & "DiskModel" & "||" & "DiskInterfaceType" & "||" & "DiskMediaType" & "||" & "DiskSerialNumber" & "||" & "DiskState" & "||" & "DiskSize" & "||" & "DiskInitType" & "||" & "DiskPartitionCount" & "||" & "WindowsRunningOnDisk (SystemDrive)" |
87 | 92 | _ArrayAdd($aDisks, $sDiskHeader, 0, "||")
|
88 |
| - $sPartitionHeader = "DiskNum" & "||" & "PartitionNum" & "||" & "PartitionID" & "||" & "PartitionType" & "||" & "PartitionIsPrimary" & "||" & "PartitionIsBootPartition" & "||" & "PartitionLetter" & "||" & "PartitionLabel" & "||" & "PartitionFileSystem" & "||" & "PartitionSizeTotal" & "||" & "PartitionSizeUsed" & "||" & "PartitionSizeFree" & "||" & "PartitionIsSystemDrive" |
| 93 | + Local $sPartitionHeader = "DiskNum" & "||" & "PartitionNum" & "||" & "PartitionID" & "||" & "PartitionType" & "||" & "PartitionIsPrimary" & "||" & "PartitionIsBootPartition" & "||" & "PartitionLetter" & "||" & "PartitionLabel" & "||" & "PartitionFileSystem" & "||" & "PartitionSizeTotal" & "||" & "PartitionSizeUsed" & "||" & "PartitionSizeFree" & "||" & "PartitionIsSystemDrive" |
89 | 94 | _ArrayAdd($aPartitions, $sPartitionHeader, 0, "||")
|
90 | 95 | $iDiskArrayCount += 1
|
91 | 96 | $iPartArrayCount += 1
|
|
0 commit comments