Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Shortcut Type File Folder Directory lnk .lnk ShortCutEdit ShortCutInfo udfShortcutType
ShortCutEdit(fShortcutName, sTarget, "", sWorkDir, @NORMAL,0) ShortCutEdit(fShortcutName, sTarget, "", sWorkDir, @NORMAL,1)
#DefineFunction udfShortcutType( linkname ) ;---------------------------------------------------------------- ; udfShortcutType( linkname ) ;---------------------------------------------------------------- ; Retunrs the type of shortcut: file or folder type ;---------------------------------------------------------------- ; linkname : full file path and .lnk file name ;---------------------------------------------------------------- ; returns: 0 if file, 1 if folder ;---------------------------------------------------------------- ; notes : ;---------------------------------------------------------------- result = ShortCutInfo( linkname ) target = ItemExtract( 1, result, @TAB ) result = 0 ; assume file If DirExist(target) result = 1 ; folder EndIf Return result #EndFunction dir = 'D:\temp\Shortcut' DirChange( dir ) lnks = FileItemize( '*.lnk' ) count = ItemCount( lnks, @TAB ) For i = 1 To count linkname = ItemExtract( i, lnks, @TAB ) type = udfShortcutType( linkname) Switch type Case 0 Pause( 'FILE LNK', linkname ) Break Case 1 Pause( 'FOLDER LNK', linkname ) Break EndSwitch Next Exit
Article ID: W18417
Filename: Shortcut Type.txt
File Created: 2009:12:15:10:25:14
Last Updated: 2009:12:15:10:25:14