I've spent a lot of time lately working on automating server builds. One of my TODOs which I finally tackled today was installing support for the Complex Script and East Asian language packs which you normally have to manually check off in the regional control panel:

If you have run Active Directory in a large environment, particularly with domain controllers in Asia or the Middle East, chances are you've gotten this event before (or a similar one):

Event Type:    Error
Event Source:    NTDS ISAM
Event Category:    General
Event ID:        604
Date:            11/17/2008
Time:            12:23:28 AM
User:            N/A
Computer:        TOKYO-DC02

Description:
NTDS (648) NTDSA: Locale ID 0x00000411 (Japanese Japanese) is either invalid or not installed on this machine.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

You get these when Outlook clients connect via NSPI and they're running one of the languages you need to manually install support for with the UI above. Checking the boxes, providing Windows with your install CD, and rebooting will take care of these errors. There's no particularly easy way to do this from a script though. Some Google searching revealed that KB289125 discusses how to do this. This blog entry also has a lengthy discussion in the comments.

I came up with the following little script which works properly on Windows Server 2003 (x86 and x64 versions). Note you'll need to reboot for these changes to be complete:

Dim shl
Set shl = WScript.CreateObject("WScript.Shell")

Dim fso
Set fso = WScript.CreateObject("Scripting.FileSystemObject")

' install complex character & far east support
WScript.Echo "Installing Complex Script and East Asian language support"
Dim intlConfig
Set intlConfig = fso.CreateTextFile("c:\scripts\intlunattend.txt")

intlConfig.WriteLine "[RegionalSettings]"
intlConfig.WriteLine "LanguageGroup = 7,11" ' 7 = Japanese, 11 = Thai
intlConfig.Close    

shl.Run "cmd /c start /wait rundll32 shell32,Control_RunDLL intl.cpl,,/f:""c:\scripts\intlunattend.txt""", 0, True
NOTE:On Windows Server 2003 x64, you need to have access to the AMD64 and i386 folders in order for this to work. I spent a bunch of time running in circles on this.

The entry point called here will use the base Windows Setup APIs, so, it will reference these two registry keys by default:

  • HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\SourcePath
  • HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath

The correct syntax for these is to point to the parent folder containing the setup files. So, if your setup files are in C:\i386, you would set these registry keys to "C:\".

If you want to specify a custom path to the installer (let's say E:\AMD64), you should add /s:"E:\AMD64" to the command (remember to double quote in VBScript) right after the /f call:

shl.Run "cmd /c start /wait rundll32 shell32,Control_RunDLL intl.cpl,,/f:""c:\scripts\intlunattend.txt"" /s:""e:\amd64""", 0, True

You can also do all this during unattended setup. Take a look at the [RegionalSettings] section of deploy.chm if you're planning on doing this as there are some caveats and additional steps (nothing complex though). Also note that I believe all this is totally different in Vista/2008 so I don't think any of this will work in that scenario