|
-
Jan 18th, 2000, 01:52 AM
#1
Thread Starter
Member
Hi,
Is there anyway to use the "SetAttr" statement to change the attributes using "*.*"?
Please advice.
-
Jan 18th, 2000, 03:58 AM
#2
You could write your own Wrapper Sub which has the Extended Capability of handling WildCards, ie.
Code:
Public Sub SetAttrEx(ByVal PathName As String, ByVal Attributes As VbFileAttribute)
Dim sDir As String
Dim sPath As String
Dim iPos As Integer
While InStr(iPos + 1, PathName, "\")
iPos = InStr(iPos + 1, PathName, "\")
Wend
If iPos Then
sPath = Left$(PathName, iPos)
Else
sPath = PathName
End If
sDir = Dir(PathName)
While Len(sDir)
If (GetAttr(sPath & sDir) And vbDirectory) <> vbDirectory Then
Call SetAttr(sPath & sDir, Attributes)
End If
sDir = Dir
Wend
End Sub
Usage:
Same as SetAttr() but can also handle Wild Cards, ie.
Call SetAttr("C:\Files\*.txt", vbReadOnly)
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 18th, 2000, 06:23 AM
#3
Thread Starter
Member
Thank you very much for your reply.
Regards
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|