02-11-2013، 12:14 AM
سلام.چطور با داشتن ادرس یک فایل اجرایی میشه شورتکاتش هر جا که خواستیم بسازیم؟؟
امتیاز موضوع:
Title: ساخت shortcut
حالت موضوعی |
'Description:
'This vb6 code allows you to create a shortcut of any file on the desktop
'Please (Project > References > Add Microsoft Script RunTime
'Public By Parsicoders.com
Public Sub CreateShortcut(FilePath As String, ShortcutName As String)
Dim Filesys As New FileSystemObject
Dim WshShell As Object
Dim oShellLink As Object
Dim DesktopPath As String
Set WshShell = CreateObject("WScript.Shell")
DesktopPath = WshShell.SpecialFolders("Desktop")
Set oShellLink = WshShell.CreateShortcut(DesktopPath & "\" & ShortcutName & ".lnk")
If Filesys.FileExists(oShellLink) Then
MsgBox ("Already Exist")
Exit Sub
End If
oShellLink.TargetPath = FilePath
oShellLink.IconLocation = FilePath
oShellLink.WorkingDirectory = FilePath
oShellLink.Save
Set oShellLink = Nothing
Set WshShell = Nothing
End Sub
Private Sub Form_Load()
Call CreateShortcut("c:\amin.txt", "parsicoders")
End Sub