Accessing 64bit registry keys via 32bit scripting languages

Accessing 64bit registry keys via 32bit scripting languages: This is a very often requirement since the evolution of 64bit platforms.  By default, an application or script receives data from the corresponding provider when two versions of providers exist. The 32-bit provider returns data to a 32-bit application, including all scripts, and the 64-bit provider returns data to the 64-bit compiled applications. However, an application or script can request data from the nondefault provider, if it exists, by notifying WMI through flags on method calls. Context Flags The __ProviderArchitecture and __RequiredArchitecture string flags have a set of values handled by WMI […]

Read more

Perl Script: Basic Template

[code language=”perl”] #! perl #=============================================================================== # Objective: # ———- # # This is a sample Perl script template. # #=============================================================================== # Include Modules #=============================================================================== use strict; use warnings; use Pod::Usage; use Getopt::Long qw(:config no_ignore_case bundling); #=============================================================================== # Global Variables Declaration #=============================================================================== use vars qw($DEBUG); #=============================================================================== # Prototypes Section #=============================================================================== sub DoAction; sub InitGlobals; sub ProcessArgs; #=============================================================================== # main() #=============================================================================== { InitGlobals(); ProcessArgs(); DoAction(); } #=============================================================================== # sub InitGlobals #=============================================================================== sub InitGlobals { } #=============================================================================== # sub ProcessArgs #=============================================================================== sub ProcessArgs { Getopt::Long::Configure("bundling", "no_ignore_case"); if (!GetOptions(‘D’ => \$DEBUG, ‘h|?’ => sub { &pod2usage(-verbose => 2)}) || @ARGV ) { pod2usage(2); } […]

Read more

Perl Script Template with basic logging functions

[code language=”perl”] #! perl #=============================================================================== # Objective: # ———- # # Sample Perl script template with basic logging functions # # # $Header: $ #=============================================================================== # Include Modules #=============================================================================== use strict; use warnings; use Pod::Usage; use Getopt::Long qw(:config no_ignore_case bundling); #=============================================================================== # Global Variables Declaration #=============================================================================== use vars qw($DEBUG); #=============================================================================== # Prototypes Section #=============================================================================== sub DoAction; sub InitGlobals; sub ProcessArgs; sub Info {my ($mesg) = @_; print "INFO: $mesg\n";} sub MyErr {my ($mesg) = @_; print "ERROR: $mesg\n"} sub MyWarn {my ($mesg) = @_; print "WARNING: $mesg\n";} sub MyDie {my ($mesg) = @_; print "ERROR: $mesg\n"; exit(1);} sub Debug {my […]

Read more