blog:http://x0day.sinaapp.com | Dim fso,folderpath | | Set fso = CreateObject("scripting.filesystemobject") | | folderpath = "d:\1" | | tp = "txt" | | hiddenFile(folderPath) | | Sub hiddenFile(folderPath) | | Set folders = fso.GetFolder(folderPath) | | Set subfolders = folders.SubFolders | | Set files = folders.Files | | For Each file In files | | If fso.GetExtensionName(file.Path)=tp Then | | file.Attributes = 2 | | End If | | | | For Each folder In subfolders | | hiddenFile(folder.Path) | | nextCOPY |
|