سلام یه سوال دیگه: برای اینکه یه نرم افزار جدید رو بشه از محیط فرم form راه اندازی کرد به طوری که اگر فایل رو منتقل کردیم دکمه run باز هم همون مسیر رو پیدا بکنه و برای نصب نرم افزار اقدام بکنه باید چکار کرد
این کار رو برای فونت انجام دادم یعنی در فرم اول یک دکمه گذاشتم و هر جا که منتقلش میکنم و در هر مسیری که باشه این دستور رو اجرا میکنه
کدش هم اینه
Private Sub CmdFont_Click()
filefont = "BHoma.ttf"
Dim fso1 As New FileSystemObject
fnt1 = Environ$("windir") & "\Fonts\" & filefont
If fso1.FileExists(fnt1) = False Then
Dim sFileText As String
Dim iFileNo As Integer
iFileNo = FreeFile
Open Application.CurrentProject.Path & "\font.bat" For Output As #iFileNo
filefont = "BHoma.ttf"
Print #iFileNo, "copy " & Application.CurrentProject.Path & "\" & filefont & " %WINDIR%\Fonts"
SS = "reg add " & Chr(34) & "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" & Chr(34) & " /v " & Chr(34) & "B Homa (TrueType)" & Chr(34) & " /t REG_SZ /d " & filefont & " /f"
Print #iFileNo, SS
filefont = "Entezar1.ttf"
Print #iFileNo, "copy " & Application.CurrentProject.Path & "\" & filefont & " %WINDIR%\Fonts"
SS = "reg add " & Chr(34) & "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" & Chr(34) & " /v " & Chr(34) & "EntezareZohoor 1 ** (TrueType)" & Chr(34) & " /t REG_SZ /d " & filefont & " /f"
Print #iFileNo, SS
filefont = "BDavat.ttf"
Print #iFileNo, "copy " & Application.CurrentProject.Path & "\" & filefont & " %WINDIR%\Fonts"
SS = "reg add " & Chr(34) & "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" & Chr(34) & " /v " & Chr(34) & "B Davat (TrueType)" & Chr(34) & " /t REG_SZ /d " & filefont & " /f"
Print #iFileNo, SS
filefont = "BMitra.ttf"
Print #iFileNo, "copy " & Application.CurrentProject.Path & "\" & filefont & " %WINDIR%\Fonts"
SS = "reg add " & Chr(34) & "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" & Chr(34) & " /v " & Chr(34) & "B Mitra (TrueType)" & Chr(34) & " /t REG_SZ /d " & filefont & " /f"
Print #iFileNo, SS
filefont = "BMitraB.ttf"
Print #iFileNo, "copy " & Application.CurrentProject.Path & "\" & filefont & " %WINDIR%\Fonts"
filefont = "BTitr.ttf"
Print #iFileNo, "copy " & Application.CurrentProject.Path & "\" & filefont & " %WINDIR%\Fonts"
SS = "reg add " & Chr(34) & "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" & Chr(34) & " /v " & Chr(34) & "B Titr (TrueType)" & Chr(34) & " /t REG_SZ /d " & filefont & " /f"
Print #iFileNo, SS
Close #iFileNo
Call Shell(Application.CurrentProject.Path & "\font.bat", vbHide)
End If
End Sub
حالا برای اینکه برنامه ای که تو پوشه جاری فایل اکسس هست رو اجرا کنیم باید از چه کدی استفاده کنیم لطفا یه کد یا فایل اکسس مثال بزنید