文件格式:vbs 作用:无厘头
Dim DYc
DYc=createobject("scripting.filesystemobject").opentextfile("ShiFuDYC.txt").readall '把文本变量赋值给变量DYc
set XouGei = server.CreateObject("Scripting.FileSystemObject")'启用文本修改功能
set XiouGei2 = XouGei.OpenTextFile(DYc, 2, false)
set XouGei = nothing
set XouGei2 = nothing
Set DaKai0 = CreateObject("WScript.Shell") '忘了干嘛的
Dim AutoRunProgram,DangQianLuJing
DangQianLuJing=createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path
DangQianLuJing=DangQianLuJing+"\Power on.vbs" '把此文件加入开机自启之获取路径
Set AutoRunProgram = WScript.CreateObject("WScript.shell")
RegPath ="HKLM\Software\Microsoft\Windows\CurrentVersion\Run\"
Type_Name = "REG_SZ"
Key_Name = "Power on.vbs"
Key_data = DangQianLuJing
AutorunProgram.RegWrite regpath&Key_Name,Key_data,Type_Name
s1=msgbox("是否打开36JY系统?",64+4,"36JY系统") '用户选择界面之是否启动系统
if s1=6 then
'代码开始
if DYc=1 then '查看是否需要初始化
ws.Run "First initialization.bat",1'如第一次打开程序,就初始化程序。
XouGei2.Write("1")
End if
ws.Run "Main program.bat",1
else
'如果选择不则关闭程序
end if
该脚本使用VBScript创建对象,读取并修改文本文件,实现开机自启动配置,并通过用户消息框进行交互确认是否启动特定程序。脚本涉及到文件操作、注册表写入以及批处理的调用。
1430

被折叠的 条评论
为什么被折叠?



