WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Shortcut Information

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

AskFileName and shortcut files

 Keywords:  AskFileName .LNK shortcut files

Question:

When I use the AskFileName function and select ".lnk" (ShortCut) files, it automatically returns the target of the ".lnk" instead of xxx.lnk file name. Is there anyway to get the ".lnk" filename instead?

Example:

 
FileList = AskFileName("Select Files to Copy", "C:\", "ALL Files|*.*",
"*.lnk", 2)
Returns:
C:\WINNT\Notepad.exe instead of notepad.lnk. 

Answer:

Sorry, no. Not with AskFileName. A number of functions "tunnel" through the link file to get to the actual target file name.

Are you just interested in lnk files? If the ones you are interested in are all in the same directory you can...

DirChange("c:\someplace")
lnklist=FileItemize("*.lnk")
mylnk=AskItemList("Choose",lnklist,@tab,@sorted,@single)



Article ID:   W14968
File Created: 2001:11:08:12:41:12
Last Updated: 2001:11:08:12:41:12