
&log( "Copying over perl and utility scripts to $bindir\n" );
`copy ntt\\perl.exe $bindir`;
`copy ntt\\perlglob.exe $bindir`;
`copy ntt\\cmd32.exe $bindir`;
`copy pl2bat.bat $bindir`;
NTRegCreateKeyEx( &HKEY_LOCAL_MACHINE, 'SOFTWARE\Microsoft\Resource Kit\PERL5',
&NULL, 'NT Perl 5', ®_OPTION_NON_VOLATILE, &KEY_ALL_ACCESS, &NULL,
$hkey, $disposition ) ?
&log( "Added key for Perl 5 to NT Registry Database..\n" ):
&gripe( "Couldn't add key for Perl 5 to NT Registry Database!!\n" );
if ( $disposition == ®_OPENED_EXISTING_KEY ) {
&gripe( "Key exists already, modifying existing key...\n" );
}
NTRegSetValueEx( $hkey, 'BIN', &NULL, ®_SZ, "$bindir" ) ?
&log( "Adding $bindir to script path information\n" ):
&gripe( "Couldn't add script path to registry!!\n" );
NTRegSetValueEx( $hkey, 'PRIVLIB', &NULL, ®_SZ, "$libdir" ) ?
&log( "Adding $libdir to library include path information\n" ):
&gripe( "Couldn't add library path to registry!!\n" );
NTRegSetValueEx( $hkey, 'HTML-DOCS', &NULL, ®_SZ, "$docdir" ) ?
&log( "Adding $docdir to documentation directory\n" ) :
&gripe( "Couldn't add documentation directory to registry!!\n" );
NTRegCloseKey( $hkey );
use Win32::Registry;
#use lib::nt.ph;
# Query the registry for path values:
local($hkey);
local($myhash);
$HKEY_LOCAL_MACHINE->Open('SOFTWARE', $hkey) || die $!;
$hkey->Open('Microsoft', $hkey) || die $!;
$hkey->Open('Resource Kit', $hkey) || die $!;
$hkey->Open('PERL5', $hkey) || die $!;
$hkey->GetValues($myhash) || die $!;
print "perl bin directory: $myhash->{'BIN'}[2]\n";
print "perl lib directory: $myhash->{'PRIVLIB'}[2]\n";
print "perl doc directory: $myhash->{'HTML-DOCS'}[2]\n";
use Win32::Registry;
print("HKEY_LOCAL_MACHINE ROOT\n");
local($hkey);
$HKEY_LOCAL_MACHINE->Open($object, $hkey) || die"Can't open Root $!";
&SearchKey($hkey, '');
sub SearchKey
{
local($Instance, $object) = @_;
local($hkey);
local (@savedkeys,$Key);
$Instance->Open($object, $hkey) || die"can t open $object $!";
$keys = [];
$hkey->GetKeys($keys)||die "Can't get keys for $object $!";
@savedkeys=@$keys;
foreach (@savedkeys)
{
$Key = $_;
last if (!defined $Key );
# print(">@$keys<\n");
if (defined $Key )
{
$Subkey .= "$_\\";
print("Parameter Key>$Key< \n");
&SearchKey($hkey,$Key);
print("After call Key>$Key< \n");
sleep(3); # only needed if you want to see what's coming
}
$hkey->Close;
};
Copyright © Robin S. Chatterjee. All rights reserved.
This page hosted by
Get your own Free Home Page