[Unattended] Default User - 'Nation'='242' Registry tweak confusion :(
Hi all, Wonder if any of you folk can point me in the right direction here, I'm more a unix chap than windows - currently deploying w2k from solaris with great success - apart from this little problem. I want to automatically set the location to United Kingdom in the regional and language options but I also want this to be default for all users. I realise this is a registry tweak, I've put a lot of hours ( many many vmware builds ) into experimentation so far I can achieve the following: As per http://unattended.msfn.org/unattended.xp/view/web/17/ I have successfully placed the registry setting Nation=242 into the registry using cmdlines.txt at T-12, my understanding from msfn is that the Default User's hive is loaded into HKEY_CURRENT_USER at this point indeed when I look at the registry after installation [HKEY_USERS/.DEFAULT/control panel/international/geo/] Nation is set to 242 as required - However, the administrator account somehow reverts to United States any subsequent users I create also default to United States ??! I have tried inserting the key into s-1-5-18 / s-1-5-19 with no luck. I also tried exporting the registry then checking the Default User Account Settings checkbox exporting the registry again so I might do a unix diff but had no luck because of the nature of the exported files. I'll keep pluging away at this simply because it is bugging the hell out of me - if I come up with a solution I will post it. In the mean time if any of you folks know how to fix my problem, I'd be most grateful if you'd post. Keep up the good work, unattended is by far the most useful piece of software I have used for a long long time - truely excellent if a little too addictive ;) Many thanks, Darren Chambers - 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
[Unattended] [unattended] Default User - 'Nation'='242' Registry tweak confusion :(
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