Prilagodi ovo svojim potrebama.
Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long
Private Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long
Private Sub Form_Load()
Dim Path as String, strSave as string
'Create a buffer string
strSave = String(200, Chr$(0))
'Get the windows directory and append '\REGEdit.exe' to it
Path = Left$(strSave, GetWindowsDirectory(strSave, Len(strSave)))
CopyFile "C:\Proba.txt", Path & "Put gdje treba da se kopira" & "Ime Fajla", 0
End Sub
|