→ tropical72:請問這是 VB 語法嗎?謝謝指教 123.195.189.79 09/14 22:10
attrib -h XXXXX.mp3
// -h是去除隱藏屬性 另外還有-r解除唯讀屬性 -a解除保存屬性 -s解除系統屬性
至於遞迴所有的資料夾啊 譬如:
Option Explicit
Dim fsys As Object, iws As Object
Sub AttribH(dir_curr)
Dim dir_sub As Object, dir_subs As Object, p As String
p = dir_curr.Path
If Right(p, 1) <> "\" Then p = p + "\"
iws.Run "attrib.exe -h """ + p + "*.mp3"""
Set dir_subs = dir_curr.SubFolders
For Each dir_sub In dir_subs
AttribH dir_sub
Next
End Sub
Sub Main()
Set fsys = CreateObject("Scripting.FileSystemObject")
Set iws = CreateObject("WScript.Shell")
AttribH fsys.GetFolder(".")
End Sub
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.137.66.166