ra700
Junior Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Zloy_Gelud, я смотрел этот скрипт, но не придумал как указать букву привода (порта), куда подключен внешний жесткий диск. Точнее- в какой строке кода: -- Generated by ScriptOMatic Tool for AutoPlay Media Studio function Escape(v) if (v == nil) then return ""; end if (type(v) == "table") then return Table.Concat(v, ", "); end if (type(v) == "boolean") then if (v == true) then return "Yes"; else return "No"; end end return v; end function WMIDateStringToDate(dtmDate) if dtmDate then dtmDate = tostring(dtmDate); return (String.Mid(dtmDate, 7, 2) .. "/" .. String.Mid(dtmDate, 5, 2) .. "/" .. String.Left(dtmDate, 4) .. " " .. String.Mid(dtmDate, 9, 2) .. ":" .. String.Mid(dtmDate, 11, 2) .. ":" .. String.Mid(dtmDate,13, 2)); else return ""; end end local strOutputTitle = ""; local strOutput = ""; strOutputTitle = strOutputTitle .. "Computer: localhost\r\n"; strOutputTitle = strOutputTitle .. "==========================================\r\n\r\n"; local objWMIService = luacom.GetObject("winmgmts:\\\\.\\root\\CIMV2"); local objColItems = objWMIService:ExecQuery("SELECT * FROM Win32_DiskDrive", "WQL", 48); if (objColItems) then local oEnum = luacom.GetEnumerator(objColItems); local objItem = oEnum:Next(); while (objItem) do strOutput = strOutput .. "Availability: " .. Escape(objItem:Availability()) .. "\r\n"; strOutput = strOutput .. "BytesPerSector: " .. Escape(objItem:BytesPerSector()) .. "\r\n"; strOutput = strOutput .. "Capabilities: " .. Escape(objItem.Capabilities(0)) .. "\r\n"; strOutput = strOutput .. "CapabilityDescriptions: " .. Escape(objItem.CapabilityDescriptions(0)) .. "\r\n"; strOutput = strOutput .. "Caption: " .. Escape(objItem:Caption()) .. "\r\n"; strOutput = strOutput .. "CompressionMethod: " .. Escape(objItem:CompressionMethod()) .. "\r\n"; strOutput = strOutput .. "ConfigManagerErrorCode: " .. Escape(objItem:ConfigManagerErrorCode()) .. "\r\n"; strOutput = strOutput .. "ConfigManagerUserConfig: " .. Escape(objItem:ConfigManagerUserConfig()) .. "\r\n"; strOutput = strOutput .. "CreationClassName: " .. Escape(objItem:CreationClassName()) .. "\r\n"; strOutput = strOutput .. "DefaultBlockSize: " .. Escape(objItem:DefaultBlockSize()) .. "\r\n"; strOutput = strOutput .. "Description: " .. Escape(objItem:Description()) .. "\r\n"; strOutput = strOutput .. "DeviceID: " .. Escape(objItem:DeviceID()) .. "\r\n"; strOutput = strOutput .. "ErrorCleared: " .. Escape(objItem:ErrorCleared()) .. "\r\n"; strOutput = strOutput .. "ErrorDescription: " .. Escape(objItem:ErrorDescription()) .. "\r\n"; strOutput = strOutput .. "ErrorMethodology: " .. Escape(objItem:ErrorMethodology()) .. "\r\n"; strOutput = strOutput .. "Index: " .. Escape(objItem:Index()) .. "\r\n"; strOutput = strOutput .. "InstallDate: " .. WMIDateStringToDate(objItem:InstallDate()) .. "\r\n"; strOutput = strOutput .. "InterfaceType: " .. Escape(objItem:InterfaceType()) .. "\r\n"; strOutput = strOutput .. "LastErrorCode: " .. Escape(objItem:LastErrorCode()) .. "\r\n"; strOutput = strOutput .. "Manufacturer: " .. Escape(objItem:Manufacturer()) .. "\r\n"; strOutput = strOutput .. "MaxBlockSize: " .. Escape(objItem:MaxBlockSize()) .. "\r\n"; strOutput = strOutput .. "MaxMediaSize: " .. Escape(objItem:MaxMediaSize()) .. "\r\n"; strOutput = strOutput .. "MediaLoaded: " .. Escape(objItem:MediaLoaded()) .. "\r\n"; strOutput = strOutput .. "MediaType: " .. Escape(objItem:MediaType()) .. "\r\n"; strOutput = strOutput .. "MinBlockSize: " .. Escape(objItem:MinBlockSize()) .. "\r\n"; strOutput = strOutput .. "Model: " .. Escape(objItem:Model()) .. "\r\n"; strOutput = strOutput .. "Name: " .. Escape(objItem:Name()) .. "\r\n"; strOutput = strOutput .. "NeedsCleaning: " .. Escape(objItem:NeedsCleaning()) .. "\r\n"; strOutput = strOutput .. "NumberOfMediaSupported: " .. Escape(objItem:NumberOfMediaSupported()) .. "\r\n"; strOutput = strOutput .. "Partitions: " .. Escape(objItem:Partitions()) .. "\r\n"; strOutput = strOutput .. "PNPDeviceID: " .. Escape(objItem:PNPDeviceID()) .. "\r\n"; strOutput = strOutput .. "PowerManagementCapabilities: " .. Escape(objItem.PowerManagementCapabilities(0)) .. "\r\n"; strOutput = strOutput .. "PowerManagementSupported: " .. Escape(objItem:PowerManagementSupported()) .. "\r\n"; strOutput = strOutput .. "SCSIBus: " .. Escape(objItem:SCSIBus()) .. "\r\n"; strOutput = strOutput .. "SCSILogicalUnit: " .. Escape(objItem:SCSILogicalUnit()) .. "\r\n"; strOutput = strOutput .. "SCSIPort: " .. Escape(objItem:SCSIPort()) .. "\r\n"; strOutput = strOutput .. "SCSITargetId: " .. Escape(objItem:SCSITargetId()) .. "\r\n"; strOutput = strOutput .. "SectorsPerTrack: " .. Escape(objItem:SectorsPerTrack()) .. "\r\n"; strOutput = strOutput .. "Signature: " .. Escape(objItem:Signature()) .. "\r\n"; strOutput = strOutput .. "Size: " .. Escape(objItem:Size()) .. "\r\n"; strOutput = strOutput .. "Status: " .. Escape(objItem:Status()) .. "\r\n"; strOutput = strOutput .. "StatusInfo: " .. Escape(objItem:StatusInfo()) .. "\r\n"; strOutput = strOutput .. "SystemCreationClassName: " .. Escape(objItem:SystemCreationClassName()) .. "\r\n"; strOutput = strOutput .. "SystemName: " .. Escape(objItem:SystemName()) .. "\r\n"; strOutput = strOutput .. "TotalCylinders: " .. Escape(objItem:TotalCylinders()) .. "\r\n"; strOutput = strOutput .. "TotalHeads: " .. Escape(objItem:TotalHeads()) .. "\r\n"; strOutput = strOutput .. "TotalSectors: " .. Escape(objItem:TotalSectors()) .. "\r\n"; strOutput = strOutput .. "TotalTracks: " .. Escape(objItem:TotalTracks()) .. "\r\n"; strOutput = strOutput .. "TracksPerCylinder: " .. Escape(objItem:TracksPerCylinder()) .. "\r\n"; if Dialog.Message("WMI Output", strOutputTitle .. strOutput, 1) == 2 then break end Output = ""; objItem = oEnum:Next(); end else Dialog.Message("WMI Output", "No WMI Objects Found for class: Win32_DiskDrive"); end | Всего записей: 76 | Зарегистр. 08-05-2007 | Отправлено: 21:17 23-06-2014 | Исправлено: ra700, 21:18 23-06-2014 |
|