by k0nsl (1 Submission)
Category: Files/File Controls/Input/Output
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (4 Votes)
Copy itself to a location specified.
Assumes
There's really nothing to know about this function other than that it can copy itself to a location specified...
'*needs to be compiled before it copies its self
Public Sub CopySelf(Path As String, NewName As String)
MyPath = App.Path & "\" & App.EXEName & ".EXE"
NewLocation = Path & "\" & NewName
On Error Resume Next
If LCase(MyPath) <> LCase(NewLocation) Then
FileCopy MyPath, NewLocation
End If
End Sub
Private Sub Form_Load()
Call CopySelf("C:\", "bleh.sys")
End Sub