Particiones del equipo

Dudas sobre el foro o cuestiones generales que no tengan cabida en otro foro.
Buenas
alguien conoce alguna forma de obtener una lista de las letras de unidades o particiones montadas en un equipo con LUA
digamos = C:, D:, E: asi
muchas gracias
muchas gracias dowsher, pero me referia a LUA no a Autoplay
first you need luacom to execute wmi

require( "luacom" )

luacom.config.abort_on_API_error = true
luacom.config.abort_on_error = false

if arg[1] == nil then
	computer = "."
else
	computer = arg[1]
end

function display( objval )
	if objval == nil then
		return ""
	end
	if type( objval ) == "table" then
		return table.concat( objval, ";" )
	end
	return tostring( objval )
end

objWMIService = luacom.GetObject( "winmgmts:{impersonationLevel=Impersonate}!//"..computer.."/root/CIMV2" )
objSWbemRefresher = luacom.CreateObject( "WbemScripting.SWbemRefresher" )
objSWbemRefresher.AutoReconnect = 1
refobjCIM_StorageVolume = objSWbemRefresher:AddEnum( objWMIService, "CIM_StorageVolume" )
objSWbemRefresher:Refresh( )
objCIM_StorageVolumeEnum = luacom.GetEnumerator( refobjCIM_StorageVolume.ObjectSet )

objSWbemRefresher:Refresh( )
objCIM_StorageVolumeEnum:Reset( )
test = refobjCIM_StorageVolume.ObjectSet.Count
if test == 1 then
	print( "1 instance:" )
else
	print( test.." instances:" )
end
print( )

objSWbemRefresher:Refresh( )
objCIM_StorageVolumeEnum:Reset( )
item = objCIM_StorageVolumeEnum:Next( )
while item do
	print( "DriveLetter                  : "..display( item:DriveLetter( ) ) )
	print( )
	item = objCIM_StorageVolumeEnum:Next( )
end
item = nil
collectgarbage( )

objWMIService = nil
objSWbemRefresher = nil
refobjCIM_StorageVolume = nil
objCIM_StorageVolumeEnum = nil
collectgarbage( )



HIDE: ON
Hidebb Message Hidden Description


if you dont want to use luacom you can use cmd or powershell execute using lua
and you can use also the io command when executing cmd or powershell
Funciono? Lo checare