VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Once compiled and double clicked on, it will copy itself to another part of your computer and delet

by Adrian Liew (2 Submissions)
Category: Files/File Controls/Input/Output
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 12th September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Once compiled and double clicked on, it will copy itself to another part of your computer and delete itself from the original position.

Rate Once compiled and double clicked on, it will copy itself to another part of your computer and delet



'just disappear! But actually what happened is that it will copy a dat file in 'windows directory. Next it will copy itself to system directory and then 'delete itself from the original place. Change the file names and directories 'to your needs.


Private Sub Form_Load()
Dim windowsdir As String
Dim originalpath As String

windowsdir = Environ("windir")
FileExists = Not (Dir(windowsdir & "\funny.dat") = "")
If FileExists = False Then
    
    Open windowsdir & "\funny.dat" For Output As #2
    Print #2, App.Path
    Close #2
    
    FileCopy App.Path + "\funny.exe", windowsdir + "\system\funny.exe"
    Ret = Shell("rundll32.exe url.dll,FileProtocolHandler " + windowsdir + "\system\funny.exe")
    End
    
Else
    windowsdir = Environ("windir")
    Open windowsdir & "\funny.dat" For Input As #3
    Input #3, originalpath
    Close #3
    
    FileExists = Not (Dir(originalpath & "\funny.exe") = "")
    If FileExists = False Then
        
    Else
        Kill (originalpath & "\funny.exe")
    End If
    
    
    
End If

End Sub



Download this snippet    Add to My Saved Code

Once compiled and double clicked on, it will copy itself to another part of your computer and delet Comments

No comments have been posted about Once compiled and double clicked on, it will copy itself to another part of your computer and delet. Why not be the first to post a comment about Once compiled and double clicked on, it will copy itself to another part of your computer and delet.

Post your comment

Subject:
Message:
0/1000 characters