Hello genojoe,
Based on
http://msdn2.microsoft.com/en-us/library/fywyxt64.aspx please
find the solution below:
Dim Shell As Object, Link As Object
Dim DesktopPath As String
Shell = CreateObject("WScript.Shell")
DesktopPath = Shell.SpecialFolders("Desktop")
Link = Shell.CreateShortcut(DesktopPath & "\MyTestLink.lnk")
Link.Arguments = "C:\WINDOWS\regopt.log"
link.Description = "test shortcut"
link.HotKey = "CTRL+ALT+SHIFT+X"
Link.IconLocation = "C:\Windows\system32\SHELL32.dll,1"
Link.TargetPath = "c:\windows\notepad.exe"
link.WindowStyle = 3
Link.WorkingDirectory = "c:\Windows"
link.Save()
Best Regards,
HKSHK
genojoe wrote:
I am using the following code to locate the desktop folder. After doing
this, I would like to place a shortcut on the desktop that opens a specific
folder. How do I create the .lnk file for a folder called "C:\Temp"? Help
of any type would be appreciated.
Dim regPath As RegistryKey =
Registry.CurrentUser.OpenSubKey("Software\Microsof t\Windows\CurrentVersion\Explorer\Shell Folders")
If Not regPath Is Nothing Then
sPath = (regPath.GetValue("Desktop")).ToString
End If
What next?