I doings some Windows 2000 splunking and have no problem adding entries to the key of interest, but it seems the registry is cached and my changes are not showing up if I open a new cmd.exe window. Can see then in regedit, and if I do a save there, the changes become visible. This leads me to thinking the registry is cached, so how do I flush it?
#!/usr/bin/perl
#------------------------------------------------
# Fun with Windows 2000 Registry
#------------------------------------------------
use strict;
my $Registry;
use Win32::TieRegistry (
TiedRef => \$Registry,
Delimiter => "/",
ArrayValues => 1,
SplitMultis => 1,
AllowLoad => 1,
AllowSave => 1,
qw( REG_SZ REG_EXPAND_SZ REG_DWORD REG_BINARY
REG_MULTI_SZ KEY_READ KEY_WRITE EY_ALL_ACCESS ),
);
my $Environment = $Registry->{"LMachine/System/CurrentControlSet/Contr
+ol/Session Manager/Environment"} or die "Can't find the Cuurent Sess
+ion Environment: $^E\n";
my $okay = $Environment->SetValue( "CRAP1", '%CDS_INST_DIR%\tools\bin'
+, 2);
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.