Creating Windows Troubleshooting Scripts in Non-English Versions of Windows

Being an English-speaking American guy working for an American company, it’s easy to kind of forget that not everybody speaks English. And that came back to bite me on a recent trip.

When I was in Japan recently, 小山田さん had come up with a really good idea: since not everyone would speak English (and my Japanese is less advanced as the average 2-year-old’s), let’s limit the lectures, and build some labs which we could pre-translate. Great idea!

One of the Windows 7 topics that they were interested in in Japan was the new Windows Troubleshooting feature. So, I built up a lab to illustrate how to use this feature.

And naturally it didn’t work at all. At least, it didn’t work on Japanese versions of Windows 7. Which is, of course, what people in Japan would be using, since they speak Japanese and all.

Fortunately, we had folks there who were pretty smart and could figure out what was going on, and I wanted to share since it’s likely to affect folks in other non-English languages as well.

In order to test the PowerShell scripts that you develop for Windows Troubleshooting, it’s helpful to run the script TestModeSetup.ps1 from the binTSPBuilder directory in the SDK. But let’s take a look at 3 important lines:

2: $OSInfo = gwmi Win32_OperatingSystem
45: if ($OSInfo.OSArchitecture -eq "32-bit") {
60: if ($OSInfo.OSArchitecture -eq "64-bit") {

It looks innocuous enough, and works great on English versions of Windows. Here’s what I see:

PS C:Userscjacks> $OSInfo = gwmi Win32_OperatingSystem
PS C:Userscjacks> $OSInfo.OSArchitecture

So, I can see exactly which branch I would take – so far so good. But what do I see if I am running 64-bit Windows on Japanese versions of Windows? 64-bit? Nope.

64 ビット


Fortunately, this is the only part of the script that fails for non-English versions of Windows. (That we noticed, anyway.) So, editing lines 45 and 60 based on the output on your system in your language should get you in shape to write Windows Troubleshooting scripts. (Just make sure you edit it from an elevated instance of Notepad, since it’s in a protected location. Or else make a copy in a non-protected location.)

Skip to main content