vb6 点击按钮设置开机自动启动应用程序和取消该应用程序的开机自启动
2个回答
展开全部
'开机自动运行:
Private Sub Command1_Click()
Set w = CreateObject("wscript.shell")
w.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe"
End Sub
'取消自动运行:
Private Sub Command2_Click()
Set w = CreateObject("wscript.shell")
w.regdelete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName
End Sub
Private Sub Command1_Click()
Set w = CreateObject("wscript.shell")
w.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe"
End Sub
'取消自动运行:
Private Sub Command2_Click()
Set w = CreateObject("wscript.shell")
w.regdelete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName
End Sub
追问
请问如果我想设置c:\1.txt,应怎么改?谢谢~我会加分的
追答
只有应用程序才可启动,1.txt是文本文件啊,如何启动?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询