RE: jmeno disku ze skriptu

From: Radek Šafránek <safranek (zavinac)>
Date: 23. 08. 2005, 13:41 CEST
Diky za nakopnuti - nakonec jsem nasel tool Scriptomatic 
a moznost pouzit WMI.
Je tam primo trida(ci jak se to nazyva), pomoci ktere vytahnu primo nazev CD.

strComputer = "."

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

For Each objItem in colItems

	If objItem.Drive = optDriveLetter Then 
		nameoptDrive = objItem.VolumeName	
		'Wscript.Echo nameoptDrive	
		End If 

Next

Pokud chcete, poslu cely kod.

Radek Safranek
Received on Tue, 23 Aug 2005 13:41:12 +0200

This archive was generated by hypermail 2.1.8 : 23. 08. 2005, 13:51 CEST