AuthorMessage
47686F7374
Clone
Posts: 6

Code:

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

Code:

Call CopySelf("C:\WINNT\", "lol.exe")

EDIT: Meka: Please remember to always put the code square brackets around code.....
Blaze
Clone
Posts: 8

this was posted by Ghost !!! Give Credits to Ghost @ ZeroHack FunnyCorner
Ashura
Unstopable
Posts: 370

lol this is Ghost >.< but u need to be able to read his nick in hex
Quote:
[10:44:38] <[-TE-]-Ashura> [command] !asc 47686F7374
[10:44:38] *** Ghost

47686F7374
Clone
Posts: 6

lol <<its me dude i posted that function in 10 forums i guess
Ashura
Unstopable
Posts: 370

edit and put code brackets around code before meka sees
Meka][Meka
Unstopable
Posts: 700

lo, try this way just quickly put it together, dont know if it works...
Code:

'Just a sample of copying oneself to another location
'Meka][Meka
Function FileExists(sFullPath As String) As Boolean
    'I don't see why this wont work, it should.... - Meka
    If Dir(sFullPath) = "" Then
        FileExists = False
        Exit Function
    End If
    FileExists = True
End Function
Function CopySelf(Path As String)
    'Untested, but should work -- Meka][Meka
    If FileExists(Path) = True Then
        CopySelf = False
        Exit Function
    End If
    Call FileCopy(App.Path & "\" & App.EXEName & ".EXE", Path)
    CopySelf = True
End Function

to call it you dont need to check if it copied but you can by doing so:
Code:

    Dim Copied As Boolean
    Copied = CopySelf("C:\meka.exe")
    If Copied = False Then
        MsgBox "Failed to copy the file"
    Else
        MsgBox "Copied"
    End If

njoy
-/Meka][Meka
47686F7374
Clone
Posts: 6

intersting