Private Sub Command1_Click()
MsgBox getfilePTY("C:\WINDOWS\notepad.exe")
End Sub
Function getfilePTY(strFl As String) As String
Dim fso 'As FileSystemObject
Dim fl 'As Scripting.File
Dim pth As String
Dim flname As String
Dim shl As Shell32.Shell
Dim shfd As Shell32.Folder
Dim s As String
Dim i
Set fso = CreateObject("scripting.filesystemobject")
Set fl = fso.GetFile(strFl)
pth = fl.ParentFolder.Path
flname = fl.Name
Set shl = New Shell
Set shfd = shl.NameSpace(pth)
For i = 0 To 33
If shfd.GetDetailsOf(0, i) <> "" Or shfd.GetDetailsOf(shfd.Items.Item(flname), i) <> "" Then
s = s & shfd.GetDetailsOf(0, i) & ": " & shfd.GetDetailsOf(shfd.Items.Item(flname), i) & Chr(10)
End If
Next i
getfilePTY = s
End Function