Write to Registry (client-side) using Javascript

This code snippet will write to registry on  a client side.
 (Only works in IE!)
 
 function writeInRegistry(path, sRegEntry, sRegValue) {
        var regpath = path + sRegEntry;
        var oShell = new ActiveXObject("WScript.Shell");
        oShell.RegWrite(regpath, sRegValue, "REG_SZ");
    }

Notes:
1. On the client side, please make sure that the UAC(User Account Control Settings is set to Never Notify)



2. Set the security settings of the Internet Explorer.
  • Internet Options
  • Security
  • Custom Level
  • Look for ActiveX controls and plug-ins
    • Mark enable option under Initialize and script ActiveX Controls not marked as safe for scripting(not secure)

    • Mark enable option under Script ActiveX Controls marked safe for scripting.

  • Click  Ok




No comments:

Post a Comment