How to copy itself

stefonalfaro

Member
Joined
Dec 3, 2007
Messages
16
Programming Experience
Beginner
I need my program to copy itself to C:\windows\system32. I have tried lots of stuff but it wont work My program is called FunnyBunny.exe. Heres my code so far


VB.NET:
        Dim FileToCopy As String
        Dim NewCopy As String

        FileToCopy = "C:\test.txt"
        NewCopy = "C:\windows\system32\funnybunny.exe"


        System.IO.File.Copy(FileToCopy, NewCopy)

The part where it says
FileToCopy ="C:\test.txt"
its supossed to be my program but it dont know how to copy it if I dont even know the location of where my program is.

So basically I want my program to copy itself.
 
Back
Top