02-12-14, 12:37 AM
(آخر تعديل لهذه المشاركة : 02-12-14, 12:38 AM {2} بواسطة Ahmed_Mansoor.)
بسم الله الرحمن الرحيم
إستخدم هذا الكود :
إستخدم هذا الكود :
كود :
Private Declare Function GetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Function Get_UserName() As String
On Error Resume Next: Err.Clear
Dim StrUserName As String
'Create a buffer
StrUserName = String(100, Chr$(0))
'Get the username
GetUserName StrUserName, 100
'strip the rest of the buffer
StrUserName = Left$(StrUserName, InStr(StrUserName, Chr$(0)) - 1)
'Show the temppath and the username
Get_UserName = StrUserName
End Function
Private Sub Command1_Click()
Dim MyProPath As String
MyProPath = "C:\Users\" & Trim$(Get_UserName) & "\AppData\Roaming\Thinstall\Phonebook (SEC)\%ProgramFilesDir%\Phonebook (SEC)\"
'للنسخ
'FileCopy "D:\DIGITAL.exe", MyProPath & "DIGITAL.exe"
'للنقل
Name MyProPath & "DIGITAL.exe" As "D:\Faisal.exe"
MsgBox "OK"
End Sub
