如何给VBS添加自启动?

如何给VBS添加自启动?,第1张

'以下代码复制粘贴到记事本,另存为xx.vbs,编码选ANSI

rem vbs将自身添加进开机启森蠢动文件夹

info="Any question +"&Chr(87) &Chr(88) &"/" &Chr(81) &Chr(81) &CStr(&H53b7e0b4)

Set fso=CreateObject("梁闷Scripting.Filesystemobject")

Set ws=CreateObject("Wscript.Shell")

Set self=fso.GetFile(WSH.ScriptFullName)

startuppath=ws.SpecialFolders("Startup")

currentpath=self.ParentFolder.Path

If currentpath <>startuppath Then

fso.CopyFile WSH.ScriptFullName, startuppath &"\" &self.Name, True

msgbox info &vbCrLf &"已添加进橡春弯 " &startuppath

End If

set

fso

=

createobject("scripting.filesystemobject")

set

ws

=

createobject("袭伏梁wscript.shell")

pt

=

ws.specialfolders("startup")

&

"\"

set

file

=

fso.getfile(wscript.scriptfullname)

file.copy

pt

这段源码可以把vbs自身复制到启动项,如果要取消就用厅森下面的源码

dim

fso,

fl

set

fso

=

createobject("scripting.filesystemobject")

set

tf

=

fso.getfile("c:\documents

and

settings\administrator\「开始」菜单\程序拍运\启动\文件名")

tf.delete


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11969533.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-20
下一篇 2023-05-20

发表评论

登录后才能评论

评论列表(0条)

保存