Easiest method to create shortcut - no API's required!
Easiest method to create shortcut - no API's required!
API Declarations
Dim objShellLink As Object
Set objWshShell = CreateObject("WScript.Shell")
Rate Easiest method to create shortcut - no API's required!
(2(2 Vote))
' so don't use Option Explicit
' or just declare variables
'
strDesktop = objWshShell.SpecialFolders("Desktop")
Set objShellLink = objWshShell.CreateShortcut(strDesktop & "\Notepad.lnk")objShellLink.TargetPath = "C:\WINNT\NOTEPAD.EXE" ' or "http://www.microsoft.com"
objShellLink.WindowStyle = 1
objShellLink.Hotkey = "CTRL+SHIFT+F"
objShellLink.IconLocation = "NOTEPAD.EXE, 0"
objShellLink.Description = "This is my shortcut!"
objShellLink.WorkingDirectory = strDesktop
objShellLink.Save
Set objShellLink = Nothing
Set objWshShell = Nothing
Easiest method to create shortcut - no API's required! Comments
No comments yet — be the first to post one!
Post a Comment