' Kod formatuje wolumin.
' Klasa Win32_Volume jest nowoci w systemie Windows Server 2003.
' ------ KONFIGURACJA SKRYPTU ------
strComputer = "<Serwer>"
strDrive = "<Napd>"  ' np. D:

strFS = "NTFS"
boolQuick = False
intClusterSize = 4096
strLabel = "Dane"
boolCompress = False
' ------ KONIEC KONFIGURACJI ---------
set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
set colVol = objWMI.ExecQuery("select * from Win32_Volume where Name = '" & _
                              strDrive & "\\'")
if colVol.Count <> 1 then
   WScript.Echo "Bd: wolumin nie zosta znaleziony."
else
   for each objVol in colVol
      intRC = objVol.Format(strFS,boolQuick,intClusterSize, _
                            strLabel,boolCompress)
      if intRC <> 0 then
         WScript.Echo "Podczas formatowania woluminu wystpi bd: " & intRC
      else
         WScript.Echo "Formatowanie woluminu zostao zakoczone powodzeniem."
      end if
   next 
end if
