' Kod przypisuje woluminowi liter napdu.
' Klasa Win32_Volume jest nowoci w systemie Windows Server 2003.
' ------ KONFIGURACJA SKRYPTU ------
strComputer = "."
strOldDrive = "I:"
strNewDrive = "J:"
' ------ KONIEC KONFIGURACJI ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colVol = objWMI.ExecQuery("select * from Win32_Volume where Name = '" & _
                              strOldDrive & "\\'")
if colVol.Count <> 1 then
   WScript.Echo "Bd: wolumin nie zosta znaleziony."
else
   for each objVol in colVol
      objVol.DriveLetter = strNewDrive
      objVol.Put_
      WScript.Echo "Przypisanie woluminowi litery napdu zostao zakoczone powodzeniem."
   next 
end if
