Question Select Shortcut path

remya1000

Well-known member
Joined
Mar 29, 2007
Messages
122
Programming Experience
Beginner
i'm using VB.NET 2003 application program.

by using OpenFileDialog, we can select the file name or file path.
VB.NET:
        OpenFileDialog1.ShowDialog()
        pgmPath.Text = OpenFileDialog1.FileName

by using FolderBrowserDialog, we can select the folder name or folder path.
VB.NET:
         FolderBrowserDialog1.ShowDialog()
        folderPath.Text = FolderBrowserDialog1.SelectedPath

is there a way i can select shortcut. i just want to select shortcut for a folder. but when i used FolderBrowserDialog, it show only the folder list. its not showing the shortcut i have.

for example: in desktop i have 4 folders, 1 EXE shortcut and 1 folder shortcut. but when i open FolderBrowserDialog it shows only 4 folders, not showing the 2 shortcuts.

a way i can show files that end with ".lnk" and select that shortcut. is there a way i can select shortcut's...

and by using this shell command i tried to open the EXE's.
VB.NET:
ProgramPath = "C:\Programs\Application1.exe"

Shell(Chr(34) & ProgramPath & Chr(34), AppWinStyle.NormalFocus)

and it works fine with all the EXE to get opened.

but when i tried to open a shortcut using the same shell comment
VB.NET:
ProgramPath = "C:\Programs\App.lnk"

Shell(Chr(34) & ProgramPath & Chr(34), AppWinStyle.NormalFocus)
error occurs... "File Not Found"

is there a way i can open the shortcut.

if anyone have any idea how to select shortcut (files that end with ".lnk") and a way i can open the shortcut, please help me. if you can provide any help, then that will be great help for me...

Thanks in advance.
 
Using Process.Start works. Shortcut .lnk files are files and will not appear in folder browser, if you need it you can of course create your own custom dialog.
 
Thanks a lot John.... that worked....

as you said i tried this code and its working...
VB.NET:
	System.Diagnostics.Process.Start(ProgramPath)

Once again, thanks a lot...
 
Back
Top