Obtencion datos de medios opticos ( y suposible uso en ams8)

Aquí puedes preguntar o compartir tus dudas y conocimientos acerca del programa
Holas a todos:

Estuve estudiando el winapi de windows con los comando y parametros wmi o wmic, para saber las caracteristicas tecnicas de un medio optico y poder llamarlo usando luacom y los comandos de sqlite clasico dentro del autoplay. El problema es que no tienen parametros exactos para:

1- marca del medio optico insertado en la bandeja del lector, esto es si es verbatim, tdk etc...
2- Que tamaño maximo de grabacion tiene ese medio por defecto (si es de 50 gb, 25, 8 gb, etc...)
3- Que tipo de medio, si es un cdrom, dvd o blue ray

Se puede saber el modelo de grabadora, si hay medio listo para grabar, cuanto tiene grabado pero no logro saber mas datos como los que he mencionado arriba. Algun cerebro gordo aqui (pabloko, downser quien pueda aportar algo si es posible obviamente...) me puede aconsejar como conseguir estos datos, que herramientas y si esa herramienta puede hacer commandline a llamar al exe. Imgburn no tiene estos comandos ni tampoco DVD Identifier....¿alguna idea?

Saludos!
con wmi puedes usar Win32_CDROMDrive

https://msdn.microsoft.com/en-us/librar ... 2147217396
Hey pabloko, ese es tipo de comando que he leido y usado pero solo datos parciales y muchos de ellos relativos a la propia unidad lectora mas que al disco optico insertado en ella, ademas no siempre te dan los datos porque estan vacios en algunos parametros, prueba este codigo en tu ams en preload y veras que no te da los datos que busco en el primer post de este hilo (no olvides cargar el plugin Luacom antes de verlo) :
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

function Escape(v)
if (type(v) == "nil" ) then return ""; end
if (type(v) == "table" ) then return Table.Concat(v, ", "); end
if (type(v) == "boolean") then return (v == true) and "Yes" or "No"; end
return v;
end

local sOutput = "";
local sOutputTitle = "Computer: localhost
==========================================

";
local oWMIService = luacom.GetObject("winmgmts:\.
ootCIMV2");
local oColItems = oWMIService:ExecQuery("SELECT * FROM Win32_CDROMDrive", "WQL", 48);
if oColItems then
local oEnum = luacom.GetEnumerator(oColItems);
local oItem = oEnum:Next();
while oItem do
sOutput = sOutput .. "Availability: " .. Escape(oItem:Availability()) .. "
";
sOutput = sOutput .. "Capabilities: " .. Escape(oItem:Capabilities()) .. "
";
sOutput = sOutput .. "CapabilityDescriptions: " .. Escape(oItem:CapabilityDescriptions()) .. "
";
sOutput = sOutput .. "Caption: " .. Escape(oItem:Caption()) .. "
";
sOutput = sOutput .. "CompressionMethod: " .. Escape(oItem:CompressionMethod()) .. "
";
sOutput = sOutput .. "ConfigManagerErrorCode: " .. Escape(oItem:ConfigManagerErrorCode()) .. "
";
sOutput = sOutput .. "ConfigManagerUserConfig: " .. Escape(oItem:ConfigManagerUserConfig()) .. "
";
sOutput = sOutput .. "CreationClassName: " .. Escape(oItem:CreationClassName()) .. "
";
sOutput = sOutput .. "DefaultBlockSize: " .. Escape(oItem:DefaultBlockSize()) .. "
";
sOutput = sOutput .. "Description: " .. Escape(oItem:Description()) .. "
";
sOutput = sOutput .. "DeviceID: " .. Escape(oItem:DeviceID()) .. "
";
sOutput = sOutput .. "Drive: " .. Escape(oItem:Drive()) .. "
";
sOutput = sOutput .. "DriveIntegrity: " .. Escape(oItem:DriveIntegrity()) .. "
";
sOutput = sOutput .. "ErrorCleared: " .. Escape(oItem:ErrorCleared()) .. "
";
sOutput = sOutput .. "ErrorDescription: " .. Escape(oItem:ErrorDescription()) .. "
";
sOutput = sOutput .. "ErrorMethodology: " .. Escape(oItem:ErrorMethodology()) .. "
";
sOutput = sOutput .. "FileSystemFlags: " .. Escape(oItem:FileSystemFlags()) .. "
";
sOutput = sOutput .. "FileSystemFlagsEx: " .. Escape(oItem:FileSystemFlagsEx()) .. "
";
sOutput = sOutput .. "Id: " .. Escape(oItem:Id()) .. "
";
sOutput = sOutput .. "InstallDate: " .. WMIDateStringToDate(oItem:InstallDate()) .. "
";
sOutput = sOutput .. "LastErrorCode: " .. Escape(oItem:LastErrorCode()) .. "
";
sOutput = sOutput .. "Manufacturer: " .. Escape(oItem:Manufacturer()) .. "
";
sOutput = sOutput .. "MaxBlockSize: " .. Escape(oItem:MaxBlockSize()) .. "
";
sOutput = sOutput .. "MaxMediaSize: " .. Escape(oItem:MaxMediaSize()) .. "
";
sOutput = sOutput .. "MaximumComponentLength: " .. Escape(oItem:MaximumComponentLength()) .. "
";
sOutput = sOutput .. "MediaLoaded: " .. Escape(oItem:MediaLoaded()) .. "
";
sOutput = sOutput .. "MediaType: " .. Escape(oItem:MediaType()) .. "
";
sOutput = sOutput .. "MfrAssignedRevisionLevel: " .. Escape(oItem:MfrAssignedRevisionLevel()) .. "
";
sOutput = sOutput .. "MinBlockSize: " .. Escape(oItem:MinBlockSize()) .. "
";
sOutput = sOutput .. "Name: " .. Escape(oItem:Name()) .. "
";
sOutput = sOutput .. "NeedsCleaning: " .. Escape(oItem:NeedsCleaning()) .. "
";
sOutput = sOutput .. "NumberOfMediaSupported: " .. Escape(oItem:NumberOfMediaSupported()) .. "
";
sOutput = sOutput .. "PNPDeviceID: " .. Escape(oItem:PNPDeviceID()) .. "
";
sOutput = sOutput .. "PowerManagementCapabilities: " .. Escape(oItem:PowerManagementCapabilities()) .. "
";
sOutput = sOutput .. "PowerManagementSupported: " .. Escape(oItem:PowerManagementSupported()) .. "
";
sOutput = sOutput .. "RevisionLevel: " .. Escape(oItem:RevisionLevel()) .. "
";
sOutput = sOutput .. "SCSIBus: " .. Escape(oItem:SCSIBus()) .. "
";
sOutput = sOutput .. "SCSILogicalUnit: " .. Escape(oItem:SCSILogicalUnit()) .. "
";
sOutput = sOutput .. "SCSIPort: " .. Escape(oItem:SCSIPort()) .. "
";
sOutput = sOutput .. "SCSITargetId: " .. Escape(oItem:SCSITargetId()) .. "
";
sOutput = sOutput .. "SerialNumber: " .. Escape(oItem:SerialNumber()) .. "
";
sOutput = sOutput .. "Size: " .. Escape(oItem:Size()) .. "
";
sOutput = sOutput .. "Status: " .. Escape(oItem:Status()) .. "
";
sOutput = sOutput .. "StatusInfo: " .. Escape(oItem:StatusInfo()) .. "
";
sOutput = sOutput .. "SystemCreationClassName: " .. Escape(oItem:SystemCreationClassName()) .. "
";
sOutput = sOutput .. "SystemName: " .. Escape(oItem:SystemName()) .. "
";
sOutput = sOutput .. "TransferRate: " .. Escape(oItem:TransferRate()) .. "
";
sOutput = sOutput .. "VolumeName: " .. Escape(oItem:VolumeName()) .. "
";
sOutput = sOutput .. "VolumeSerialNumber: " .. Escape(oItem:VolumeSerialNumber()) .. "
";
if (Dialog.Message("WMI Output", sOutputTitle .. sOutput, 1) == 2) then break; end
sOutput = "";
oItem = oEnum:Next();
end
else
Dialog.Message("WMI Output", "No WMI Objects Found for class: Win32_Binary");
end


Puto luacode, dejo el archivo
http://textuploader.com/do20c
Puess el problema es que no tengo unidad en ninguno de mis equipos, hace bastantes años que no uso discos ni dvds, ni en el portatil porque puse un ssd... no puedo probarlo... pero tiene buena pinta