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)
- next
复制代码
|