EmEditor Home - EmEditor Help - EmEditor Macro Reference - Tutorial

Manipulate the Registry

To manipulate the registry, use the RegRead Method, RegWrite Method, and RegDelete Method of WshShell Object.

The following example code reads the file name of a running macro from the registry, and displays it.


WshShell = new ActiveXObject( "WScript.Shell" );
str = WshShell.RegRead( "HKCU\\Software\\EmSoft\\EmEditor v3\\Common\\MacroFile" );
alert( str );


Set WshShell = CreateObject( "WScript.Shell" )
str = WshShell.RegRead( "HKCU\Software\EmSoft\EmEditor v3\Common\MacroFile" )
alert str


In JavaScript, if you want to include a backslash "\" within a string, it must be preceded by another backslash "\\".


Microsoft MSDN Library: RegRead Method

Copyright 2003-2016 by Emurasoft, Inc.