运行后刷新可以看到注册表的新值,可是打开ie后,发现收藏仍没有变
打开注册表,看到改的值又恢复到c:\documents and settings\...
为什么???
dim WShell,CharMainHtml,strFavLocation,strDocuments,strDesktop
set WShell=createobject("Wscript.Shell")
charmainhtml=inputbox("请输入新的'主页'地址","主页更改","about:blank")
strFavLocation=inputbox("请输入新的'收藏'地址","收藏地址更改","G:\BackUp\PERSONAL\admin\Favorites")
strDocuments=inputbox("请输入新的'我的文档'地址","我的文档地址更改","G:\BackUp\PERSONAL\admin\My Documents")
strDesktop=inputbox("请输入新的'桌面'地址","我的文档地址更改","G:\BackUp\PERSONAL\admin\桌面") if not isNullChar(charmainhtml) then
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page",charmainhtml
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools",0
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Favorites",strFavLocation
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal",strDocuments
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop",strDesktop
end if function isNullChar(chr)
tmChr=trim(chr)
if len(tmchr)=0 then
isNullChar=true
else
isNullChar=false
end if
end function
打开注册表,看到改的值又恢复到c:\documents and settings\...
为什么???
dim WShell,CharMainHtml,strFavLocation,strDocuments,strDesktop
set WShell=createobject("Wscript.Shell")
charmainhtml=inputbox("请输入新的'主页'地址","主页更改","about:blank")
strFavLocation=inputbox("请输入新的'收藏'地址","收藏地址更改","G:\BackUp\PERSONAL\admin\Favorites")
strDocuments=inputbox("请输入新的'我的文档'地址","我的文档地址更改","G:\BackUp\PERSONAL\admin\My Documents")
strDesktop=inputbox("请输入新的'桌面'地址","我的文档地址更改","G:\BackUp\PERSONAL\admin\桌面") if not isNullChar(charmainhtml) then
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\Start Page",charmainhtml
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\DisableRegistryTools",0
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Favorites",strFavLocation
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal",strDocuments
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Desktop",strDesktop
end if function isNullChar(chr)
tmChr=trim(chr)
if len(tmchr)=0 then
isNullChar=true
else
isNullChar=false
end if
end function
wshell.regwrite "HKEY_CURRENT_USER\Software\Microsoft......\user Shell Folders\Desktop",strDesktop
就可以改favorite了!