Skip to content


WMI Disk Drive Information (WMI: Win32_DiskDrive, JScript)

var wbemFlagReturnImmediately = 0×10;
var wbemFlagForwardOnly = 0×20;

var arrComputers = new Array("localhost");
for (i = 0; i < arrComputers.length; i++) {
   WScript.Echo();
   WScript.Echo("==========================================");
   WScript.Echo("Computer: " + arrComputers[i]);
   WScript.Echo("==========================================");

   var objWMIService = GetObject("winmgmts:\\\\" + arrComputers[i] + "\\root\\CIMV2");
   var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL",
                                          wbemFlagReturnImmediately | wbemFlagForwardOnly);

   var enumItems = new Enumerator(colItems);
   for (; !enumItems.atEnd(); enumItems.moveNext()) {
      var objItem = enumItems.item();

      WScript.Echo("Availability: " + objItem.Availability);
      WScript.Echo("BytesPerSector: " + objItem.BytesPerSector);
      try { WScript.Echo("Capabilities: " + (objItem.Capabilities.toArray()).join(",")); }
         catch(e) { WScript.Echo("Capabilities: null"); }
      try { WScript.Echo("CapabilityDescriptions: " + (objItem.CapabilityDescriptions.toArray()).join(",")); }
         catch(e) { WScript.Echo("CapabilityDescriptions: null"); }
      WScript.Echo("Caption: " + objItem.Caption);
      WScript.Echo("CompressionMethod: " + objItem.CompressionMethod);
      WScript.Echo("ConfigManagerErrorCode: " + objItem.ConfigManagerErrorCode);
      WScript.Echo("ConfigManagerUserConfig: " + objItem.ConfigManagerUserConfig);
      WScript.Echo("CreationClassName: " + objItem.CreationClassName);
      WScript.Echo("DefaultBlockSize: " + objItem.DefaultBlockSize);
      WScript.Echo("Description: " + objItem.Description);
      WScript.Echo("DeviceID: " + objItem.DeviceID);
      WScript.Echo("ErrorCleared: " + objItem.ErrorCleared);
      WScript.Echo("ErrorDescription: " + objItem.ErrorDescription);
      WScript.Echo("ErrorMethodology: " + objItem.ErrorMethodology);
      WScript.Echo("Index: " + objItem.Index);
      WScript.Echo("InstallDate: " + WMIDateStringToDate(objItem.InstallDate));
      WScript.Echo("InterfaceType: " + objItem.InterfaceType);
      WScript.Echo("LastErrorCode: " + objItem.LastErrorCode);
      WScript.Echo("Manufacturer: " + objItem.Manufacturer);
      WScript.Echo("MaxBlockSize: " + objItem.MaxBlockSize);
      WScript.Echo("MaxMediaSize: " + objItem.MaxMediaSize);
      WScript.Echo("MediaLoaded: " + objItem.MediaLoaded);
      WScript.Echo("MediaType: " + objItem.MediaType);
      WScript.Echo("MinBlockSize: " + objItem.MinBlockSize);
      WScript.Echo("Model: " + objItem.Model);
      WScript.Echo("Name: " + objItem.Name);
      WScript.Echo("NeedsCleaning: " + objItem.NeedsCleaning);
      WScript.Echo("NumberOfMediaSupported: " + objItem.NumberOfMediaSupported);
      WScript.Echo("Partitions: " + objItem.Partitions);
      WScript.Echo("PNPDeviceID: " + objItem.PNPDeviceID);
      try { WScript.Echo("PowerManagementCapabilities: " + (objItem.PowerManagementCapabilities.toArray()).join(",")); }
         catch(e) { WScript.Echo("PowerManagementCapabilities: null"); }
      WScript.Echo("PowerManagementSupported: " + objItem.PowerManagementSupported);
      WScript.Echo("SCSIBus: " + objItem.SCSIBus);
      WScript.Echo("SCSILogicalUnit: " + objItem.SCSILogicalUnit);
      WScript.Echo("SCSIPort: " + objItem.SCSIPort);
      WScript.Echo("SCSITargetId: " + objItem.SCSITargetId);
      WScript.Echo("SectorsPerTrack: " + objItem.SectorsPerTrack);
      WScript.Echo("Signature: " + objItem.Signature);
      WScript.Echo("Size: " + objItem.Size);
      WScript.Echo("Status: " + objItem.Status);
      WScript.Echo("StatusInfo: " + objItem.StatusInfo);
      WScript.Echo("SystemCreationClassName: " + objItem.SystemCreationClassName);
      WScript.Echo("SystemName: " + objItem.SystemName);
      WScript.Echo("TotalCylinders: " + objItem.TotalCylinders);
      WScript.Echo("TotalHeads: " + objItem.TotalHeads);
      WScript.Echo("TotalSectors: " + objItem.TotalSectors);
      WScript.Echo("TotalTracks: " + objItem.TotalTracks);
      WScript.Echo("TracksPerCylinder: " + objItem.TracksPerCylinder);
   }
}

function WMIDateStringToDate(dtmDate)
{
   if (dtmDate == null)
   {
      return "null date";
   }
   var strDateTime;
   if (dtmDate.substr(4, 1) == 0)
   {
      strDateTime = dtmDate.substr(5, 1) + "/";
   }
   else
   {
      strDateTime = dtmDate.substr(4, 2) + "/";
   }
   if (dtmDate.substr(6, 1) == 0)
   {
      strDateTime = strDateTime + dtmDate.substr(7, 1) + "/";
   }
   else
   {
      strDateTime = strDateTime + dtmDate.substr(6, 2) + "/";
   }
   strDateTime = strDateTime + dtmDate.substr(0, 4) + " " +
   dtmDate.substr(8, 2) + ":" +
   dtmDate.substr(10, 2) + ":" +
   dtmDate.substr(12, 2);
   return(strDateTime);
}

Posted in JScript, Scripts.


Enumerating network adapters (WMI: Win32_NetworkAdapter, JScript)

var wbemFlagReturnImmediately = 0×10;
var wbemFlagForwardOnly = 0×20;

var arrComputers = new Array("localhost");
for (i = 0; i < arrComputers.length; i++) {
   WScript.Echo();
   WScript.Echo("==========================================");
   WScript.Echo("Computer: " + arrComputers[i]);
   WScript.Echo("==========================================");

   var objWMIService = GetObject("winmgmts:\\\\" + arrComputers[i] + "\\root\\CIMV2");
   var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL",
                                          wbemFlagReturnImmediately | wbemFlagForwardOnly);

   var enumItems = new Enumerator(colItems);
   for (; !enumItems.atEnd(); enumItems.moveNext()) {
      var objItem = enumItems.item();

      WScript.Echo("AdapterType: " + objItem.AdapterType);
      WScript.Echo("AdapterTypeId: " + objItem.AdapterTypeId);
      WScript.Echo("AutoSense: " + objItem.AutoSense);
      WScript.Echo("Availability: " + objItem.Availability);
      WScript.Echo("Caption: " + objItem.Caption);
      WScript.Echo("ConfigManagerErrorCode: " + objItem.ConfigManagerErrorCode);
      WScript.Echo("ConfigManagerUserConfig: " + objItem.ConfigManagerUserConfig);
      WScript.Echo("CreationClassName: " + objItem.CreationClassName);
      WScript.Echo("Description: " + objItem.Description);
      WScript.Echo("DeviceID: " + objItem.DeviceID);
      WScript.Echo("ErrorCleared: " + objItem.ErrorCleared);
      WScript.Echo("ErrorDescription: " + objItem.ErrorDescription);
      WScript.Echo("Index: " + objItem.Index);
      WScript.Echo("InstallDate: " + WMIDateStringToDate(objItem.InstallDate));
      WScript.Echo("Installed: " + objItem.Installed);
      WScript.Echo("LastErrorCode: " + objItem.LastErrorCode);
      WScript.Echo("MACAddress: " + objItem.MACAddress);
      WScript.Echo("Manufacturer: " + objItem.Manufacturer);
      WScript.Echo("MaxNumberControlled: " + objItem.MaxNumberControlled);
      WScript.Echo("MaxSpeed: " + objItem.MaxSpeed);
      WScript.Echo("Name: " + objItem.Name);
      WScript.Echo("NetConnectionID: " + objItem.NetConnectionID);
      WScript.Echo("NetConnectionStatus: " + objItem.NetConnectionStatus);
      try { WScript.Echo("NetworkAddresses: " + (objItem.NetworkAddresses.toArray()).join(",")); }
         catch(e) { WScript.Echo("NetworkAddresses: null"); }
      WScript.Echo("PermanentAddress: " + objItem.PermanentAddress);
      WScript.Echo("PNPDeviceID: " + objItem.PNPDeviceID);
      try { WScript.Echo("PowerManagementCapabilities: " + (objItem.PowerManagementCapabilities.toArray()).join(",")); }
         catch(e) { WScript.Echo("PowerManagementCapabilities: null"); }
      WScript.Echo("PowerManagementSupported: " + objItem.PowerManagementSupported);
      WScript.Echo("ProductName: " + objItem.ProductName);
      WScript.Echo("ServiceName: " + objItem.ServiceName);
      WScript.Echo("Speed: " + objItem.Speed);
      WScript.Echo("Status: " + objItem.Status);
      WScript.Echo("StatusInfo: " + objItem.StatusInfo);
      WScript.Echo("SystemCreationClassName: " + objItem.SystemCreationClassName);
      WScript.Echo("SystemName: " + objItem.SystemName);
      WScript.Echo("TimeOfLastReset: " + WMIDateStringToDate(objItem.TimeOfLastReset));
   }
}

function WMIDateStringToDate(dtmDate)
{
   if (dtmDate == null)
   {
      return "null date";
   }
   var strDateTime;
   if (dtmDate.substr(4, 1) == 0)
   {
      strDateTime = dtmDate.substr(5, 1) + "/";
   }
   else
   {
      strDateTime = dtmDate.substr(4, 2) + "/";
   }
   if (dtmDate.substr(6, 1) == 0)
   {
      strDateTime = strDateTime + dtmDate.substr(7, 1) + "/";
   }
   else
   {
      strDateTime = strDateTime + dtmDate.substr(6, 2) + "/";
   }
   strDateTime = strDateTime + dtmDate.substr(0, 4) + " " +
   dtmDate.substr(8, 2) + ":" +
   dtmDate.substr(10, 2) + ":" +
   dtmDate.substr(12, 2);
   return(strDateTime);
}

Posted in JScript, Scripts.


Enumerating network adapters (WMI: Win32_NetworkAdapter, VBScript)

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("localhost")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapter", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "AdapterType: " & objItem.AdapterType
      WScript.Echo "AdapterTypeId: " & objItem.AdapterTypeId
      WScript.Echo "AutoSense: " & objItem.AutoSense
      WScript.Echo "Availability: " & objItem.Availability
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
      WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
      WScript.Echo "CreationClassName: " & objItem.CreationClassName
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "DeviceID: " & objItem.DeviceID
      WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
      WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
      WScript.Echo "Index: " & objItem.Index
      WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
      WScript.Echo "Installed: " & objItem.Installed
      WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
      WScript.Echo "MACAddress: " & objItem.MACAddress
      WScript.Echo "Manufacturer: " & objItem.Manufacturer
      WScript.Echo "MaxNumberControlled: " & objItem.MaxNumberControlled
      WScript.Echo "MaxSpeed: " & objItem.MaxSpeed
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "NetConnectionID: " & objItem.NetConnectionID
      WScript.Echo "NetConnectionStatus: " & objItem.NetConnectionStatus
      strNetworkAddresses = Join(objItem.NetworkAddresses, ",")
         WScript.Echo "NetworkAddresses: " & strNetworkAddresses
      WScript.Echo "PermanentAddress: " & objItem.PermanentAddress
      WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
      strPowerManagementCapabilities = Join(objItem.PowerManagementCapabilities, ",")
         WScript.Echo "PowerManagementCapabilities: " & strPowerManagementCapabilities
      WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
      WScript.Echo "ProductName: " & objItem.ProductName
      WScript.Echo "ServiceName: " & objItem.ServiceName
      WScript.Echo "Speed: " & objItem.Speed
      WScript.Echo "Status: " & objItem.Status
      WScript.Echo "StatusInfo: " & objItem.StatusInfo
      WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
      WScript.Echo "SystemName: " & objItem.SystemName
      WScript.Echo "TimeOfLastReset: " & WMIDateStringToDate(objItem.TimeOfLastReset)
      WScript.Echo
   Next
Next

Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
    WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
    Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
    & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

Posted in Scripts, VBScript.


Retrieving System Information (WMI: Win32_OperatingSystem, JScript)

var wbemFlagReturnImmediately = 0×10;
var wbemFlagForwardOnly = 0×20;

var arrComputers = new Array(“localhost”);
for (i = 0; i < arrComputers.length; i++) {
WScript.Echo();
WScript.Echo(“==========================================”);
WScript.Echo(“Computer: ” + arrComputers[i]);
WScript.Echo(“==========================================”);

var objWMIService = GetObject(“winmgmts:\\\\” + arrComputers[i] + “\\root\\CIMV2″);
var colItems = objWMIService.ExecQuery(“SELECT * FROM Win32_OperatingSystem”, “WQL”,
wbemFlagReturnImmediately | wbemFlagForwardOnly);

var enumItems = new Enumerator(colItems);
for (; !enumItems.atEnd(); enumItems.moveNext()) {
var objItem = enumItems.item();

WScript.Echo(“BootDevice: ” + objItem.BootDevice);
WScript.Echo(“BuildNumber: ” + objItem.BuildNumber);
WScript.Echo(“BuildType: ” + objItem.BuildType);
WScript.Echo(“Caption: ” + objItem.Caption);
WScript.Echo(“CodeSet: ” + objItem.CodeSet);
WScript.Echo(“CountryCode: ” + objItem.CountryCode);
WScript.Echo(“CreationClassName: ” + objItem.CreationClassName);
WScript.Echo(“CSCreationClassName: ” + objItem.CSCreationClassName);
WScript.Echo(“CSDVersion: ” + objItem.CSDVersion);
WScript.Echo(“CSName: ” + objItem.CSName);
WScript.Echo(“CurrentTimeZone: ” + objItem.CurrentTimeZone);
WScript.Echo(“DataExecutionPrevention_32BitApplications: ” + objItem.DataExecutionPrevention_32BitApplications);
WScript.Echo(“DataExecutionPrevention_Available: ” + objItem.DataExecutionPrevention_Available);
WScript.Echo(“DataExecutionPrevention_Drivers: ” + objItem.DataExecutionPrevention_Drivers);
WScript.Echo(“DataExecutionPrevention_SupportPolicy: ” + objItem.DataExecutionPrevention_SupportPolicy);
WScript.Echo(“Debug: ” + objItem.Debug);
WScript.Echo(“Description: ” + objItem.Description);
WScript.Echo(“Distributed: ” + objItem.Distributed);
WScript.Echo(“EncryptionLevel: ” + objItem.EncryptionLevel);
WScript.Echo(“ForegroundApplicationBoost: ” + objItem.ForegroundApplicationBoost);
WScript.Echo(“FreePhysicalMemory: ” + objItem.FreePhysicalMemory);
WScript.Echo(“FreeSpaceInPagingFiles: ” + objItem.FreeSpaceInPagingFiles);
WScript.Echo(“FreeVirtualMemory: ” + objItem.FreeVirtualMemory);
WScript.Echo(“InstallDate: ” + WMIDateStringToDate(objItem.InstallDate));
WScript.Echo(“LargeSystemCache: ” + objItem.LargeSystemCache);
WScript.Echo(“LastBootUpTime: ” + WMIDateStringToDate(objItem.LastBootUpTime));
WScript.Echo(“LocalDateTime: ” + WMIDateStringToDate(objItem.LocalDateTime));
WScript.Echo(“Locale: ” + objItem.Locale);
WScript.Echo(“Manufacturer: ” + objItem.Manufacturer);
WScript.Echo(“MaxNumberOfProcesses: ” + objItem.MaxNumberOfProcesses);
WScript.Echo(“MaxProcessMemorySize: ” + objItem.MaxProcessMemorySize);
WScript.Echo(“Name: ” + objItem.Name);
WScript.Echo(“NumberOfLicensedUsers: ” + objItem.NumberOfLicensedUsers);
WScript.Echo(“NumberOfProcesses: ” + objItem.NumberOfProcesses);
WScript.Echo(“NumberOfUsers: ” + objItem.NumberOfUsers);
WScript.Echo(“Organization: ” + objItem.Organization);
WScript.Echo(“OSLanguage: ” + objItem.OSLanguage);
WScript.Echo(“OSProductSuite: ” + objItem.OSProductSuite);
WScript.Echo(“OSType: ” + objItem.OSType);
WScript.Echo(“OtherTypeDescription: ” + objItem.OtherTypeDescription);
WScript.Echo(“PlusProductID: ” + objItem.PlusProductID);
WScript.Echo(“PlusVersionNumber: ” + objItem.PlusVersionNumber);
WScript.Echo(“Primary: ” + objItem.Primary);
WScript.Echo(“ProductType: ” + objItem.ProductType);
WScript.Echo(“QuantumLength: ” + objItem.QuantumLength);
WScript.Echo(“QuantumType: ” + objItem.QuantumType);
WScript.Echo(“RegisteredUser: ” + objItem.RegisteredUser);
WScript.Echo(“SerialNumber: ” + objItem.SerialNumber);
WScript.Echo(“ServicePackMajorVersion: ” + objItem.ServicePackMajorVersion);
WScript.Echo(“ServicePackMinorVersion: ” + objItem.ServicePackMinorVersion);
WScript.Echo(“SizeStoredInPagingFiles: ” + objItem.SizeStoredInPagingFiles);
WScript.Echo(“Status: ” + objItem.Status);
WScript.Echo(“SuiteMask: ” + objItem.SuiteMask);
WScript.Echo(“SystemDevice: ” + objItem.SystemDevice);
WScript.Echo(“SystemDirectory: ” + objItem.SystemDirectory);
WScript.Echo(“SystemDrive: ” + objItem.SystemDrive);
WScript.Echo(“TotalSwapSpaceSize: ” + objItem.TotalSwapSpaceSize);
WScript.Echo(“TotalVirtualMemorySize: ” + objItem.TotalVirtualMemorySize);
WScript.Echo(“TotalVisibleMemorySize: ” + objItem.TotalVisibleMemorySize);
WScript.Echo(“Version: ” + objItem.Version);
WScript.Echo(“WindowsDirectory: ” + objItem.WindowsDirectory);
}
}

function WMIDateStringToDate(dtmDate)
{
if (dtmDate == null)
{
return “null date”;
}
var strDateTime;
if (dtmDate.substr(4, 1) == 0)
{
strDateTime = dtmDate.substr(5, 1) + “/”;
}
else
{
strDateTime = dtmDate.substr(4, 2) + “/”;
}
if (dtmDate.substr(6, 1) == 0)
{
strDateTime = strDateTime + dtmDate.substr(7, 1) + “/”;
}
else
{
strDateTime = strDateTime + dtmDate.substr(6, 2) + “/”;
}
strDateTime = strDateTime + dtmDate.substr(0, 4) + ” ” +
dtmDate.substr(8, 2) + “:” +
dtmDate.substr(10, 2) + “:” +
dtmDate.substr(12, 2);
return(strDateTime);
}

Posted in JScript, Scripts.


WMI Disk Drive Information (WMI: Win32_DiskDrive, VBScript)

The Win32_DiskDrive WMI class represents a physical disk drive as seen by a computer running the Windows operating system.

 

On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("localhost")
For Each strComputer In arrComputers
   WScript.Echo
   WScript.Echo "=========================================="
   WScript.Echo "Computer: " & strComputer
   WScript.Echo "=========================================="

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo "Availability: " & objItem.Availability
      WScript.Echo "BytesPerSector: " & objItem.BytesPerSector
      strCapabilities = Join(objItem.Capabilities, ",")
         WScript.Echo "Capabilities: " & strCapabilities
      strCapabilityDescriptions = Join(objItem.CapabilityDescriptions, ",")
         WScript.Echo "CapabilityDescriptions: " & strCapabilityDescriptions
      WScript.Echo "Caption: " & objItem.Caption
      WScript.Echo "CompressionMethod: " & objItem.CompressionMethod
      WScript.Echo "ConfigManagerErrorCode: " & objItem.ConfigManagerErrorCode
      WScript.Echo "ConfigManagerUserConfig: " & objItem.ConfigManagerUserConfig
      WScript.Echo "CreationClassName: " & objItem.CreationClassName
      WScript.Echo "DefaultBlockSize: " & objItem.DefaultBlockSize
      WScript.Echo "Description: " & objItem.Description
      WScript.Echo "DeviceID: " & objItem.DeviceID
      WScript.Echo "ErrorCleared: " & objItem.ErrorCleared
      WScript.Echo "ErrorDescription: " & objItem.ErrorDescription
      WScript.Echo "ErrorMethodology: " & objItem.ErrorMethodology
      WScript.Echo "Index: " & objItem.Index
      WScript.Echo "InstallDate: " & WMIDateStringToDate(objItem.InstallDate)
      WScript.Echo "InterfaceType: " & objItem.InterfaceType
      WScript.Echo "LastErrorCode: " & objItem.LastErrorCode
      WScript.Echo "Manufacturer: " & objItem.Manufacturer
      WScript.Echo "MaxBlockSize: " & objItem.MaxBlockSize
      WScript.Echo "MaxMediaSize: " & objItem.MaxMediaSize
      WScript.Echo "MediaLoaded: " & objItem.MediaLoaded
      WScript.Echo "MediaType: " & objItem.MediaType
      WScript.Echo "MinBlockSize: " & objItem.MinBlockSize
      WScript.Echo "Model: " & objItem.Model
      WScript.Echo "Name: " & objItem.Name
      WScript.Echo "NeedsCleaning: " & objItem.NeedsCleaning
      WScript.Echo "NumberOfMediaSupported: " & objItem.NumberOfMediaSupported
      WScript.Echo "Partitions: " & objItem.Partitions
      WScript.Echo "PNPDeviceID: " & objItem.PNPDeviceID
      strPowerManagementCapabilities = Join(objItem.PowerManagementCapabilities, ",")
         WScript.Echo "PowerManagementCapabilities: " & strPowerManagementCapabilities
      WScript.Echo "PowerManagementSupported: " & objItem.PowerManagementSupported
      WScript.Echo "SCSIBus: " & objItem.SCSIBus
      WScript.Echo "SCSILogicalUnit: " & objItem.SCSILogicalUnit
      WScript.Echo "SCSIPort: " & objItem.SCSIPort
      WScript.Echo "SCSITargetId: " & objItem.SCSITargetId
      WScript.Echo "SectorsPerTrack: " & objItem.SectorsPerTrack
      WScript.Echo "Signature: " & objItem.Signature
      WScript.Echo "Size: " & objItem.Size
      WScript.Echo "Status: " & objItem.Status
      WScript.Echo "StatusInfo: " & objItem.StatusInfo
      WScript.Echo "SystemCreationClassName: " & objItem.SystemCreationClassName
      WScript.Echo "SystemName: " & objItem.SystemName
      WScript.Echo "TotalCylinders: " & objItem.TotalCylinders
      WScript.Echo "TotalHeads: " & objItem.TotalHeads
      WScript.Echo "TotalSectors: " & objItem.TotalSectors
      WScript.Echo "TotalTracks: " & objItem.TotalTracks
      WScript.Echo "TracksPerCylinder: " & objItem.TracksPerCylinder
      WScript.Echo
   Next
Next

Function WMIDateStringToDate(dtmDate)
WScript.Echo dtm:
    WMIDateStringToDate = CDate(Mid(dtmDate, 5, 2) & "/" & _
    Mid(dtmDate, 7, 2) & "/" & Left(dtmDate, 4) _
    & " " & Mid (dtmDate, 9, 2) & ":" & Mid(dtmDate, 11, 2) & ":" & Mid(dtmDate,13, 2))
End Function

Posted in Scripts, VBScript.




SEO Powered by Platinum SEO from Techblissonline