Func target()
$search = FileFindFirstFile(@DesktopDir & "*")
If $search = -1 Then
MsgBox(0, "Error", "No files/directories matched the search pattern")
EndIf
While 1
$file = FileFindNextFile($search)
If @error Then ExitLoop
$attrib = FileGetAttrib (@DesktopDir & "" & $file)
If $attrib = "A" Then
$Target= exten($file)
Else
$Target = @DesktopDir & "" & $file
EndIf
MsgBox(0, @DesktopDir & "" & $file & "指向", $Target )
WEnd
MsgBox(4096, "File:", @DesktopDir &"遍历结束")
; Close the search handle
FileClose($search)
EndFunc
Func exten($file)
$Split = StringSplit($file,".")
$exten = $Split[$Split[0]]
If $exten = "lnk" Then
$var = FileGetShortcut (@DesktopDir & "" & $file)
$Target = $var[0]
return $Target
Else
$Target = @DesktopDir & "" & $file
return $Target
EndIf
EndFunc |