Security Basics mailing list archives

RE: Tutorial on writing to Registery


From: "Yvan G.J. Boily" <yboily () seccuris com>
Date: Fri, 15 Oct 2004 12:40:29 -0500

Took me awhile to find time to do this.

Batch scripting is still an option, but is *heavily* obviated by the kind of
control you can achieve with a Windows Scripting Host file.

This is a complete script, including proper error handling, which will run
in either the Window or Console scripting host.
if you attempt to run it in the Windowed host it will report a message
detailing the appropriate usage.
As with all code snippets and samples I make available, this is distributed
without Warranty, and represents a small amount of time 
invested.  There may be issues with using this code in production, and it
has not been heavily tested, other than verification that 
it works for reading, writing, and deleting the registry keys in question.

// Recommendations:
// Back up the following Registry key before experimenting with this script:
//
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU

// Hope this is what you were looking for.
// Regards,
// Yvan Boily.

// Sample Code to read and write registry keys 
// to run this script from the command line:
// cscript mru.js

For the actual sample code, due to restrictions on security-basics@ I have
moved it to my web page.

http://yboily.is-a-geek.net/downloads/

mru.js is the source for the script

Also, there is a signature file for those who wish to verify authenticity.
My public key can be found on my web page at:
http://yboily.is-a-geek.net/pgpkey.master

Warning.  This is a Windows Scripting Host file, and should be downloaded
and inspected prior to running.  I have written it in such a way that it
should not impact anything (aside from your most recently used list from the
Start Menu->Run option), but you should always review scripts you download
from an untrusted source.



Current thread: