How to Use js to modify the client registry _ javascript tips-js tutorial

Source: Internet
Author: User
This article introduces how to use js to modify the client registry. If you need it, refer to it. The Code is as follows:


Try
{
Var shell = new ActiveXObject ("WScript. Shell ");

// Read the registry value
Var key1 = shell. RegRead ("HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run \ eip ");

// Delete the registry key
Shell. RegDelete ("HKEY_CURRENT_USER \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run \ eip ");

// Write a value to the Registry
Shell. RegWrite
("HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Run \ eip ",
"C: \ eip. lnk", "REG_SZ ");
Shell. RegWrite ("HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Run \ eip ",
"C: \ eip. lnk", "REG_SZ ");
}
Catch (e)
{}


You can use the last backslash to terminate an item. Do not include a backslash when specifying a Value Name.


Type description
REG_SZ string
REG_DWORD integer
REG_BINARY binary value integer
REG_EXPAND_SZ extensible string (for example, "% windir % \ calc.exe ")

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.