System.Diagnostics.Process.Start(IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "WinRAR\winrar.exe"))
طبعا الكود المتعارف عليه لاستدعاء اي برنامج وليكن winrar
System.Diagnostics.Process.Start(c:\WINRAR\winrar.exe)
لكن اذا كان هناك شخص اخر نزل الوينرار في مسار آخر يمككنا معرفة ذلك عن طريق هذا الكود
System.Diagnostics.Process.Start(IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "WinRAR\winrar.exe"))
اذا اصبح المسار الان غير مهم وهذا سوف يساعدك في اشياء كثير
الان الى كود التحقق
اذا كان البرنامج موجود او لا
في العاده نحتاج مسار البرنامج لكن في هذا الكود ايضا لن نحتاجه
طبعا كود التحقق معروف
Dim fExists As Boolean
fExists = My.Computer.FileSystem.FileExists(IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "WinRAR\winrar.exe"))
If fExists = True Then
System.Diagnostics.Process.Start(IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "WinRAR\winrar.exe"))
Else
MsgBox("file not found")
System.Diagnostics.Process.Start("http://www.rarlab.com/download.htm") 'لتحميل البرنامج من الانترنت
End Ifاتمنى ان اكون افدتكم