求用VB编一个程序Autorun.exe!

来源:百度知道 编辑:UC知道 时间:2024/06/22 07:13:55
我在网上找了很多这样的相关信息可是还是没用!我用记事本写了一个Autorun.inf 里面加入的代码是: [Autorun]
open=Setup.exe
icon=Setup.exe
程序的名字也是Setup,且按要求放置在U盘根目录下,当插入U盘时界面上就出现了“运行Setup.exe”,如果不点击它而仅仅是打开U盘,Setep.exe这个程序就不会自动运行。现在我的要求就是编制一个VB程序使得当U盘插入时,打开U盘这个程序就自动运行!先给20分,答得好我会追加的!

我原意帮你完成程序!不过我要100分,因为这个有些例外;自动运行嘛隐藏系统文件开机自动运行进程防守!不过本人不知能否帮到你(我读大学)周末做 

Form1的Code:

Dim autotime As Integer '声明自动打开U盘的倒计时变量

Private Sub Check1_Click()

 If Check1.Value = 1 Then '写自动打开U盘的配置文件

  filenum = FreeFile

  Open App.Path & "autoSet.dat" For Output As #filenum

  Print #filenum, "1" '开启

  Close #filenum

 Else

    filenum = FreeFile

  Open App.Path & "autoSet.dat" For Output As #filenum

  Print #filenum, "0" '关闭

  Close #filenum

 End If

End Sub

Private Sub Command1_Click()

Shell "explorer