VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



CopySelf

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...

Rate CopySelf

'*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

Download this snippet    Add to My Saved Code

CopySelf Comments

No comments have been posted about CopySelf. Why not be the first to post a comment about CopySelf.

Post your comment

Subject:
Message:
0/1000 characters