home!





Microsoft things 'n stuff



Windows things 'n stuff

Registry entries for network cards;

HKLM\System\Currentcontrolset\Control\Network\[ID]
HKLM\System\Currentcontrolset\Services\[ID]
HKLM\System\Currentcontrolset\Services\Tcpip\parameters\Interfaces\[ID]

Here are the locations to find the nics of a Windows machine, in case of a rogue nic (one that's hidden but Windows still complains about IP settings) find the right ID for the card (usually by checking the IP settings under the ID key) and remove that ID from these locations.


Running infrared monitor service without terminal service

Infrared monitor won't start on Windows XP without starting the terminal services service. Why? No idea because it works for Windows 2000.
To get it to run anyway, open the key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Irmon, remove TermService from the DependOnService string and reboot.
To get Windows XP to react when connecting the Nokia mobile to the laptop I also need to start the Shell hardware detection service.


Change the My Computer icon text to the local computer name;

Open regedit and search for the string {20D04FE0-3AEA-1069-A2D8-08002B30309D}, you will find it under HKEY_CLASSES_ROOT\CLSID.
Change the value of LocalizedString to %computername%, or a combination of variables like %username% on %computername%. To see what variable can be used, open a command prompt and type set. Don't forget to surround the variables with a % sign.
A nice one for domain pc's is %username%@%userdomain%\%computername% or %username%@%computername%.%userdnsdomain% (don't forget the dot between computername and userdnsdomain).
Click on the desktop and hit F5 to refresh the icon text.


explorer.exe/iexplore.exe doesn't start

If explorer won't start, and trying to start it in a command prompt or through task manager gives the error explorer.exe not found, delete the following registry entry;
HKEY_LOCAL_MACHINE\software\microsoft\windows nt\currentversion\image file execution options\explorer.exe
For trouble with Internet Explorer delete the iexplore.exe entry.


Run Exchange system manager without local admin rights

Add the user/group in local security policy to Create global objects user rights.


Access denied to device, path, file error trying to open a .msc file


Most likely cause is a corrupt mscfile entry in the registry, importing it from a clean Vista installation resolved the issue for me.
The .reg file.


Setting regional settings through group policy and vb script

Setting the regional settings for a user can be done by running a vb script that changes the registry at logon through group policy.
This I've created to have multiple timezones available on one terminal server. The RDP client sets only keyboard settings so I had to come up with an idea.
The vb script changes the regional settings in the current_user registry and it takes effect immediately.

(for Windows 2003)
download script for Dutch (NL): set_regional_NL.vbs

The dutch settings example;

const HKEY_CURRENT_USER = &H80000001
strComputer = "."


Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")

strKeyPath = "Control Panel\International"
strValueName = "iCountry"
strValue = "31"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "iCurrency"
strValue = "2"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "iDate"
strValue = "1"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "iMeasure"
strValue = "0"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "iNegCurr"
strValue = "11"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "iTime"
strValue = "1"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "Locale"
strValue = "00000413"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "s1159"
strValue = ""
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "s2359"
strValue = ""
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sCountry"
strValue = "Netherlands"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sCurrency"
strValue = "€"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sDate"
strValue = "-"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sDecimal"
strValue = ","
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sLanguage"
strValue = "NLD"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sList"
strValue = ";"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sLongDate"
strValue = "dddd d MMMM yyyy"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sShortDate"
strValue = "d-M-yyyy"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sThousand"
strValue = "."
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sTimeFormat"
strValue = "H:mm:ss"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sMonDecimalSep"
strValue = ","
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "sMonThousandSep"
strValue = "."
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "iFirstDayOfWeek"
strValue = "0"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strValueName = "FirstWeekOfYear"
strValue = "2"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue

strKeyPath = "Control Panel\International\Geo"
strValueName = "Nation"
strValue = "176"
oReg.SetStringValue HKEY_CURRENT_USER,strKeyPath,strValueName,strValue


Download script for United States (US): set_regional_US.vbs


Active Directory replication fails

Little known fact; when the free disk space of the volume that contains the Sysvol share gets below 1 GB, the file replication service stops running. :-/


Printers default page size to A4 instead of letter format

To have printers set to default A4 when adding them to a printserver, set the non-unicode language to English (United Kingdom) or other non-letter country.
Just setting the Location in Regional settings to anything else than United States does not make a difference, as far as I've tested with generic and HP 4000 series printers on Windows 2003.

non unicode setting


Replace printer connections through vb script

This script's been used after replacing printservers and printer queues to automatically change it on user's clients and terminal sessions;
So far it's been used on Windows XP, Vista and 2003. There are more scripts available but not all worked so this one's been made from bits and pieces found all over.
(text in bold are notes, these don't belong in the vbs file)


' Set variables

strComputer = "."
set oKey = CreateObject("wscript.shell")
Set oNewPrinter = CreateObject("WScript.Network")


' Create list of printernames in profile, replace old printer connection

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colPrinters = objWMIService.ExecQuery _
    ("Select * from Win32_Printer")

'wscript.echo "Start replace"   For testing purposes this will pop up a dialog after removing the starting '

For Each oPrinter in colPrinters
    printername = lcase(oPrinter.Name)
    select case printername
        Case "\\printserver\printer0001", "\\server0004\printer0001"   Printserver is a dns alias for server0004, queues can be connected to either name
            oPrinter.delete_   Printer0001 will only be removed, not replaced by another
        Case "\\printserver\printer0003", "\\server0004\printer0003"
            if (oPrinter.Attributes AND 4) = 4 then   Checking if the printer is set as default
                defPrinter = true   Is default
            else
                defPrinter = false   Is not default
            end if
            oPrinter.delete_   Remove old queue before adding the new queue
            oNewPrinter.AddWindowsPrinterConnection "\\printserver\printer0003"   Add the new queue
            if defPrinter = true then
                oNewPrinter.SetDefaultPrinter "\\printserver\printer0003"   Set the printer queue as default
            end if
        Case "\\printserver\printer0005", "\\server0004\printer0005"   Lather, rinse, repeat for every possible queue
            if (oPrinter.Attributes AND 4) = 4 then
                defPrinter = true
            else
                defPrinter = false
            end if
            oPrinter.delete_
            oNewPrinter.AddWindowsPrinterConnection "\\printserver\printer0002-pcl"   A printer with both postscript and pcl drivers
            oNewPrinter.AddWindowsPrinterConnection "\\printserver\printer0002-ps"   Because sometimes there's a problem with ps drivers
            if defPrinter = true then
                oNewPrinter.SetDefaultPrinter "\\printserver\printer0002-ps"
            end if
    end select
Next

'wscript.echo "End replace"   Again, for testing purposes


NTVDM error trying to print

In this case the NTVDM error came while trying to print to a remote network printer from Exact Globe for Windows (older version).
This started after the Windows 2003 terminal server for this application got its latest updates.
The solution was to install a local (PDF) printer, setting it as default and in the case of Exact setting the forms to the network printer, keeping the PDF printer as default as well.



Office 2007 things 'n stuff

Using the Office Customization Tool still leaves some annoying dialogs open that you might not want to show to users on your terminal server.
So, here are the keys to get rid of them:

Remove Windows Desktop Search download dialog

Add the following registry entry to the default user hive:
HKEY_USERS\.DEFAULT\Software\Microsoft\Office\12.0\Outlook\Options\General; REG_SZ; PONT_STRING, value '60, '
Download registry file; 2007_pont_string.reg


Remove the security settings dialog

Add the following registry entry to the default user hive:
HKEY_USERS\.DEFAULT\Software\Microsoft\Office\12.0\Common\General; DWORD; ShownOptIn, value 1
Download registry file; 2007_shownoptin.reg


Remove the RSS synchronisation dialog

Add the following registry entry to the default user hive:
HKEY_USERS\.DEFAULT\Software\Microsoft\Office\12.0\Outlook\Options\RSS; DWORD; SyncToSysCFL, value 0 to disable, 1 to enable
Download registry file; 2007_rss_synctosyscfl.reg


Spell check language or thesaurus not available in Word

If the MUI or proofing tools are installed, but the language doesn't show up in Word, remove the entries under HKEY_USER\software\microsoft\shared tools\proofing tools\1.0\override.

Enable Live preview under terminal services

If the option for Live preview is grayed out under Word 2007 options it can be enabled by turning on one option in the visual settings for Windows.
I've set this under 2003 Terminal servers, but it might also work for XP and Vista.

Rightclick "My computer", select properties, open the advanced tab and click on Settings under Performance.
Enable in the list the Smooth-scrolling list boxes option.
This option was the only one needed even if RDP connection settings are set on the lowest bandwidth setting.

To set this in the registry change HKCU\Control panel\Desktop\UserPreferencesMask to b8 12 01 80 (b0 12 01 80 means everything is turned off so it's more approprate for Terminal servers)

Note: This seemed to only work for an admin account, a test user needed the mask ba 3a 01 80 for Live preview to work.
Most likely it might work with several combinations of options.



Miscellaneous things 'n stuff

SetDWORDValue() function and hexadecimal values

During the creation of a vb script to create registry entries for Autodesk Trueview 2009 I found the function SetDWORDValue does weird things with hexadecimal values.
Trying to add anything that's &H0000xxxx where xxxx doesn't start with a 0 results in a type mismatch error. The same thing happened with the &Hffffffff value.
Using a value that's &Hxxxx, omitting the first four zeros, just resulted in a value &Hffffxxxx.

No wonder I hear developers complain about VB.

Workaround is to manually convert the hexadecimal numbers to decimal because using function CLng() or CInt() resulted in wrong numbers as well. :-/
As I couldn't find anything about this quickly on Google I'll experiment later with it.


DepCheck indicates XPSEPSC Installer is not installed,
or, Windows update failes to install


This error popped up during installation of .Net 3.5 SP1, search results gave plenty of attempts to get it fixed, yet a lot of these didn't seem to work.
Remembering Windows update errors I had before, I renamed spupdsvc.exe under system32 and ran the setup again. This did the trick.
Usually this file is returned to system32 during an installation, so afterwards the renamed file can be removed.


File permissions for accessing directories

To only traverse directories, from the shared root set traverse folder/execute file + read (extended) attributes for the group/user.
The directory the group/user needs access to can get the normal read/write permissions.
This hides everything without a need to block inherited permissions from the root folder.




The reason why is just as important
as the answer to the question

mail? nystrom.nl, marcel