منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
لانشاء اختصار على سطح المكتب - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : الأقسام التعليمية - المنتدى القديم (http://vb4arb.com/vb/forumdisplay.php?fid=90)
+--- قسم : مكتبة أكواد المنتدى (http://vb4arb.com/vb/forumdisplay.php?fid=111)
+---- قسم : مكتبة أكواد الفيجوال بيسك 6 (http://vb4arb.com/vb/forumdisplay.php?fid=116)
+---- الموضوع : لانشاء اختصار على سطح المكتب (/showthread.php?tid=6022)



لانشاء اختصار على سطح المكتب - RaggiTech - 17-10-12

كاتب الموضوع : Boutemine Oualid

السلام عليكم و رحمة الله وبركاته


كود :
Option Explicit
'Add a reference to Windows Script Host Object Model (wshom.ocx).
Private Sub CreateShortCutOnDeskTop()
Dim Wsh As New WshShell
Dim DesktopPath As String
Dim FileName As String
Dim Shortcut As Variant
DesktopPath = Wsh.SpecialFolders("Desktop")
FileName = DesktopPath & "\MyAppli.lnk"
If FileExist(FileName) = False Then
Set Shortcut = Wsh.CreateShortcut(FileName)
With Shortcut
.TargetPath = App.Path & "\" & App.EXEName
.Description = "My Program"
.WindowStyle = 4
.Save
End With
End If
End Sub
Private Function FileExist(ByRef inFile As String) As Boolean
On Error Resume Next
Let FileExist = CBool(FileLen(inFile) + 1)
End Function