Show/Hide Toolbars

EmEditor Help

Navigation: EmEditor Help > Macro Reference > Tutorial

EmEditor Macro Reference: Manipulate the Registry

Scroll Prev Top Next More
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.

[JavaScript]

WshShell = new ActiveXObject( "WScript.Shell" );

str = WshShell.RegRead( "HKCU\\Software\\EmSoft\\EmEditor v3\\Common\\MacroFile" );

alert( str );

[VBScript]

Set WshShell = CreateObject( "WScript.Shell" )

str = WshShell.RegRead( "HKCU\Software\EmSoft\EmEditor v3\Common\MacroFile" )

alert str

Tips:

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

References

g Microsoft MSDN Library: RegRead Method

Copyright © 2003-2016 by Emurasoft, Inc.