set objFSO = CreateObject("Scripting.FileSystemObject")
set objFolder = objFSO.getFolder("C:\")
'Kolekcja pod folderów:
for each strFolder in objFolder.SubFolders
	Wscript.StdOut.WriteLine "[DIR]" & strFolder.Name
next
'Kolekcja plików:
for each strFile in objFolder.Files
	Wscript.StdOut.WriteLine strFile & " " & strFile.size & " " & showAttrHumanReadable(strFile.attributes)
next

function showAttrHumanReadable(atr)
	buffer = ""
	if (atr and 1)>0 then
		buffer = buffer & "[R]" 'Read only
	end if
	if (atr and 2)>0 then
		buffer = buffer & "[H]" 'Hidden
	end if
	if (atr and 4)>0 then
		buffer = buffer & "[S]" 'System
	end if
	showAttrHumanReadable = buffer
end function