منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
ازاي اعمل shortcut file - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : ازاي اعمل shortcut file (/showthread.php?tid=36897)



ازاي اعمل shortcut file - اليوم السابع - 12-11-20

السلام عليكم عندي هذا الملف في المسار ده 
C:\Program Files\king\Debug\King Master 4.1.0.exe
ازاي اعمل shortcut للملف ده King Master 4.1.0.exe علي الديسك توب او سطح المكتب


RE: ازاي اعمل shortcut file - سعود - 12-11-20

هل يلبي الرابط ماتريد؟


RE: ازاي اعمل shortcut file - اليوم السابع - 12-11-20

(12-11-20, 02:58 PM)سعود كتب : هل يلبي الرابط ماتريد؟

الله يبارك لك اخي سعود


RE: ازاي اعمل shortcut file - اليوم السابع - 12-11-20

(12-11-20, 02:58 PM)سعود كتب : هل يلبي الرابط ماتريد؟

بس هو بيعمل الشورت كات في نفس المجلد مش علي سطح المكتب

(12-11-20, 08:15 PM)اليوم السابع كتب :
(12-11-20, 02:58 PM)سعود كتب : هل يلبي الرابط ماتريد؟

بس هو بيعمل الشورت كات في نفس المجلد مش علي سطح المكتب

هذا هو الكود بفك ضغط ملف بجانب المشروع ومن ثم بأخذ ملف من المجلد شورت كات علي الديسك توب ولكن بيضع الملف داخل نفس المجلد وليس سطح المكتب 
كود :
Dim archive As IArchive = ArchiveFactory.Open("Debug.rar")
       For Each entry In archive.Entries
           If Not entry.IsDirectory Then
               Console.WriteLine(entry.Key)
               entry.WriteToDirectory("C:\Program Files\king1", New ExtractionOptions With
                             {.ExtractFullPath = True, .Overwrite = True})
           End If
       Next
       Dim path As String = "C:\Program Files\king1\Debug\King Master 4.1.0.exe"
       Dim thing As New WshShell
       Dim shortcut As IWshShortcut
       If IO.File.Exists(path) = False And IO.Directory.Exists(path) = False Then
           MsgBox("path is not correct")
           Exit Sub
       End If
       shortcut = CType(thing.CreateShortcut(path & ".lnk"), IWshShortcut)
       shortcut.TargetPath = path
       shortcut.Save()



RE: ازاي اعمل shortcut file - Anas Mahmoud - 13-11-20

كود :
Dim DesktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim lnkPath As string = DesktopPath & "Test.lnk"

       Dim thing As New WshShell

       Dim shortcut As IWshShortcut
shortcut CType(thing.CreateShortcut(lnkPath), IWshShortcut)
shortcut.TargetPath = path
shortcut.Save()



RE: ازاي اعمل shortcut file - اليوم السابع - 14-11-20

(13-11-20, 02:30 PM)Anas Mahmoud كتب :
كود :
Dim DesktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim lnkPath As string = DesktopPath & "Test.lnk"

       Dim thing As New WshShell

       Dim shortcut As IWshShortcut
shortcut CType(thing.CreateShortcut(lnkPath), IWshShortcut)
shortcut.TargetPath = path
shortcut.Save()

شكرا اخي ولكن لم يحدث شئ ما زال لا يعمل شورت كات


RE: ازاي اعمل shortcut file - got - 14-11-20

(13-11-20, 02:30 PM)Anas Mahmoud كتب :
كود :
       Dim path As String = "C:\Program Files\king1\Debug\King Master 4.1.0.exe"
Dim DesktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim lnkPath As string = DesktopPath & "\Test.lnk"

       Dim thing As New WshShell

       Dim shortcut As IWshShortcut
shortcut CType(thing.CreateShortcut(lnkPath), IWshShortcut)
shortcut.TargetPath = path
shortcut.Save()



RE: ازاي اعمل shortcut file - اليوم السابع - 14-11-20

(14-11-20, 02:06 AM)got كتب :
(13-11-20, 02:30 PM)Anas Mahmoud كتب :
كود :
       Dim path As String = "C:\Program Files\king1\Debug\King Master 4.1.0.exe"
Dim DesktopPath As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim lnkPath As string = DesktopPath & "\Test.lnk"

       Dim thing As New WshShell

       Dim shortcut As IWshShortcut
shortcut CType(thing.CreateShortcut(lnkPath), IWshShortcut)
shortcut.TargetPath = path
shortcut.Save()

الله ينور عليك