'************************
'不足之处,欢迎指正
'注:vista下无效
'written by maomaochong
'2009.9.18
'************************
on error resume next
set ws=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
set sa=createobject("shell.application")
Set ucd = CreateObject("UserAccounts.CommonDialog")
do
'---------------------------------功能选择---------------------------------------------
start=inputbox("请输入相应的数字选择功能(按取消退出):" & vbcrlf & vbcrlf & "1.美化" & vbcrlf & "2.恢复","~~欢迎使用~~","1")
select case start
case "1"
'-----------------------------------美化-----------------------------------------------
str="美化"
fld=sf (str)
'---------------------------------选择图片---------------------------------------------
msgbox "接下来请选择您要作为背景添加的图片~~",64+4096
ucd.filter="图像文件(*.jpg;*.jpeg;*.bmp)|*.jpg;*.jpeg;*.bmp"
show = ucd.showopen
if show then
set pic=fso.getfile(ucd.filename)
else
msgbox "欢迎下次使用!",64+4096
wscript.quit
end if
'---------------------------------删除旧背景-------------------------------------------
if fso.fileexists (fld & "\background.jpg") then
fso.deletefile (fld & "\background.jpg"),true
elseif fso.fileexists (fld & "\background.jpeg") then
fso.deletefile (fld & "\background.jpeg"),true
elseif fso.fileexists (fld & "\background.bmp") then
fso.deletefile (fld & "\background.bmp"),true
else
end if
pic.copy fld & "\background." & fso.getextensionname(pic) '拷贝图片
'-------------------------------创建desktop.ini----------------------------------------
if fso.fileexists (fld & "\desktop.ini") then fso.deletefile (fld & "\desktop.ini"),true
set dt=fso.createtextfile(fld & "\desktop.ini")
dt.writeline "[ExtShellFolderViews]"
dt.writeline "{BE098140-A513-11D0-A3A4-00C04FD706EC}={BE098140-A513-11D0-A3A4-00C04FD706EC}"
dt.writeline "[{BE098140-A513-11D0-A3A4-00C04FD706EC}]"
dt.writeline "IconArea_Image=background." & fso.getextensionname(pic)
dt.writeline "Attributes=1"
dt.writeline "IconArea_Text=0x00000000"
'dt.writeline "[.ShellClassInfo]" '预留功能
'不足之处,欢迎指正
'注:vista下无效
'written by maomaochong
'2009.9.18
'************************
on error resume next
set ws=createobject("wscript.shell")
set fso=createobject("scripting.filesystemobject")
set sa=createobject("shell.application")
Set ucd = CreateObject("UserAccounts.CommonDialog")
do
'---------------------------------功能选择---------------------------------------------
start=inputbox("请输入相应的数字选择功能(按取消退出):" & vbcrlf & vbcrlf & "1.美化" & vbcrlf & "2.恢复","~~欢迎使用~~","1")
select case start
case "1"
'-----------------------------------美化-----------------------------------------------
str="美化"
fld=sf (str)
'---------------------------------选择图片---------------------------------------------
msgbox "接下来请选择您要作为背景添加的图片~~",64+4096
ucd.filter="图像文件(*.jpg;*.jpeg;*.bmp)|*.jpg;*.jpeg;*.bmp"
show = ucd.showopen
if show then
set pic=fso.getfile(ucd.filename)
else
msgbox "欢迎下次使用!",64+4096
wscript.quit
end if
'---------------------------------删除旧背景-------------------------------------------
if fso.fileexists (fld & "\background.jpg") then
fso.deletefile (fld & "\background.jpg"),true
elseif fso.fileexists (fld & "\background.jpeg") then
fso.deletefile (fld & "\background.jpeg"),true
elseif fso.fileexists (fld & "\background.bmp") then
fso.deletefile (fld & "\background.bmp"),true
else
end if
pic.copy fld & "\background." & fso.getextensionname(pic) '拷贝图片
'-------------------------------创建desktop.ini----------------------------------------
if fso.fileexists (fld & "\desktop.ini") then fso.deletefile (fld & "\desktop.ini"),true
set dt=fso.createtextfile(fld & "\desktop.ini")
dt.writeline "[ExtShellFolderViews]"
dt.writeline "{BE098140-A513-11D0-A3A4-00C04FD706EC}={BE098140-A513-11D0-A3A4-00C04FD706EC}"
dt.writeline "[{BE098140-A513-11D0-A3A4-00C04FD706EC}]"
dt.writeline "IconArea_Image=background." & fso.getextensionname(pic)
dt.writeline "Attributes=1"
dt.writeline "IconArea_Text=0x00000000"
'dt.writeline "[.ShellClassInfo]" '预留功能