Advertisement
Guest User

Untitled

a guest
Mar 4th, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.82 KB | None | 0 0
  1. Func _GetExtProperty($sPath, $iProp)
  2.     Local $iExist, $sFile, $sDir, $oShellApp, $oDir, $oFile, $aProperty, $sProperty
  3.     $iExist = FileExists($sPath)
  4.     If $iExist = 0 Then
  5.         SetError(1)
  6.         Return 0
  7.     Else
  8.         $sFile = StringTrimLeft($sPath, StringInStr($sPath, "\", 0, -1))
  9.         $sDir = StringTrimRight($sPath, (StringLen($sPath) - StringInStr($sPath, "\", 0, -1)))
  10.         $oShellApp = ObjCreate ("shell.application")
  11.         $oDir = $oShellApp.NameSpace ($sDir)
  12.         $oFile = $oDir.Parsename ($sFile)
  13.         If $iProp = -1 Then
  14.             Local $aProperty[35]
  15.             For $i = 0 To 34
  16.                 $aProperty[$i] = $oDir.GetDetailsOf ($oFile, $i)
  17.             Next
  18.             Return $aProperty
  19.         Else
  20.             $sProperty = $oDir.GetDetailsOf ($oFile, $iProp)
  21.             If $sProperty = "" Then
  22.                 Return 0
  23.             Else
  24.                 Return $sProperty
  25.             EndIf
  26.         EndIf
  27.     EndIf
  28. EndFunc   ;==>_GetExtProperty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement