我用vb6.0做了个程序,怎么让它随机启动

来源:百度知道 编辑:UC知道 时间:2024/05/29 14:19:08
最好是免杀的方法
我写的程序放在D:\apple\an\ee.exe
请写全代码!我加分!

简单。添加到注册表RUN

Option Explicit
'---------------处理注册表的函数-----------------------
Private Declare Function RegCreateKey& Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey&, ByVal lpszSubKey$, lphKey&)
Private Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long

Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_SZ = 1

'HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
Private Sub Command1_Click()
'声明变量
Dim sKeyName As String, sKeyValue As String, sKeyValueIcon As String
Dim Ret As Integer, lphKey As Long

sKeyName = "Software\Microsoft\Windows\CurrentVersion\Run"
sKeyValue = App.Path & IIf(Len(App.Path) > 3, "\" & App