Hi Folks,
I did a little more reading & managed to solve this problem by modifying the
ws2k3notips.pl script.
I put the following into nation.pl & call from base.bat:
------------------
use warnings;
use strict;
@ARGV == 0
or die "Usage: $0";
my %reg;
use Win32::TieRegistry (Delimiter => '/', TiedHash => \%reg, qw(REG_DWORD
REG_BINARY REG_MULTI_SZ));
# Replace %VAR% with environment variable VAR in a string.
sub expand_vars ($) {
my ($arg) = @_;
while ($arg =~ /%([^%]+)%/) {
my $var = $1;
my $val = $ENV{$var};
$val =~ /%/
and die 'Internal error (time to rewrite expand_vars)';
$arg =~ s/%$var%/$val/g;
}
return $arg;
}
# Get profiles directory and default user subdirectory
my $profile_list =
'LMachine/SOFTWARE/Microsoft/Windows NT/CurrentVersion/ProfileList/';
my $profile_list_key = $reg{$profile_list};
defined $profile_list_key
or die "Unable to read $profile_list: $^E";
my $profiles_dir = $profile_list_key->{'/ProfilesDirectory'};
defined $profiles_dir
or die "Unable to read /ProfilesDirectory: $^E";
$profiles_dir = expand_vars ($profiles_dir);
my $default_user = $profile_list_key->{'/DefaultUserProfile'};
defined $default_user
or die "Unable to read /DefaultUserProfile: $^E";
# Get HKEY_CURRENT_USER key
my $cuser_key = $reg{'CUser/'};
# Get .default user key
my $defuser_key = $reg{'Users/.DEFAULT/'};
# Get NTUSER.DAT registry hive key
$reg{'/'}->AllowLoad (1)
or die "Unable to enable loading of hive files: $^E";
my $ntuser_dat = "$profiles_dir\\$default_user\\NTUSER.DAT";
my $ntuser_key = $reg{'Users'}->Load ($ntuser_dat, 'NTUSER')
or die "Unable to load registry hive $ntuser_dat: $^E";
# Setup keys for per-user
foreach my $reg_key ($cuser_key, $defuser_key, $ntuser_key) {
$reg_key->{'Control Panel/'} = {
'International/' => {
'Geo/' => {
'/Nation' => "242",
}
},
} or die "Unable to set User/Control Panel/ registry settings: $^E";
} # End
exit 0;
-----------------------------
Hope this helps someone :)
Cheers,
Darren
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
unattended-info mailing list
unattended-info@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unattended-info