Video Screencast Help
Symantec Secure Login will be live on Connect starting February 25. Get the details here.

Scripted OS Install - Part 5: Tweaking Windows (Round 1)

Created: 30 Oct 2007 • Updated: 24 Apr 2009 | 1 comment
Language Translations
trb48's picture
+1 1 Vote
Login to vote

It has been a while. Sorry for the delay, but the good news is the series continues! So far in the series we have created a custom Windows XP install CD by:

- Integrating Windows updates and hotfixes - Creating an answer file that completely automates the install process - Adding drivers for the computer models we want to support

So far we have created something very useful. It is still lacking in a few areas. We have been able to customize the back end of Windows. We can make it install with any settings we need for our environment. Now it is time to work on the front end.

Every time I install Windows the first thing that I do is go through and customize Windows. In all of the years I have been using Windows (and installing Windows) I have never left Windows alone. I always make dozens of changes. When I say tweaking, what do I mean? A few examples are icons on the desktop, desktop background, show hidden files and folders, and loads of group policies. When building an image, this is an important step, probably the most important to they user (because it is the most visible).

In short there is still a lot of work to do after Windows installs. What if we could integrate all of these customizations into the installation process? Well we can. Lets spend a few minutes going through the basics.

Setting the Foundation:

In the first article we copied a Windows XP CD to our local computer. I usually copy the CD to a folder on my desktop called "WinXP." In the next article we created an answer file, this is created in the I386 folder. In the last article we added drivers into the mix. Now, we want to customize how Windows works. There are several different ways to do this. The first we will discuss deals with the $OEM$ folder. In the last article we used this folder to help install drivers. Now we will use this folder to customize Windows.

Before we jump into the $OEM$ folder we need to understand the users on the computer, what they do, and why they are there.


The way that user accounts function in Windows XP was a great improvement over Windows 98. Do you remember creating accounts in Windows 98, making sure that they all had passwords. Then, you went to log in and you could hit "Cancel" and get right in? Things are very different now (thankfully). The user folders can be found in the following location:

C:\Documents and Settings. Lets take a look at the folder:

Check this out to see what the WinXP folder should look like.

I will briefly explain each folder, how it was created, and why it was created. I will start with the first account created to the last.

  • Default User: This is the first account created in Windows. It is created during the install process. When there is about 10 minutes left while Windows installing everything is needed to create a user account. Everything that happens in the last few minutes sets up the Default user account. Every account that is created hereafter uses the Default User as template.
  • All Users: This isn't an account that you can log into. Instead, it is an account that provides some settings, icons, and files that apply to all of the users. This is really generic because it has to work on all accounts (for a user that has all privileges and a user that barely has any).
  • Administrator: This account is created right toward the end of Windows installing. Like is mentioned earlier, it uses the Default User as a template to create the account (this is important, that is why I said it twice). This account is given rights to do everything on the computer. It is an important account.
  • Localuser: I create this account after Windows installs.

Now we understand how Windows creates and treats user accounts we can start customizing Windows. If we have a tweak that we want to apply to all users it would be nice if we could apply it to the Default User account. That way, when other accounts are created it already has the setting. We can do that with the $OEM$ folder.

$OEM$ Folder (Part 2):

The $OEM$ folder needs to be created in the I386 folder. Inside the $OEM$ folder, create a file named "CMDLINES.TXT". Think of this file like it is a BAT or CMD file. It is run right after the Default User account is created. You can run programs, files, or registry keys from this file. All settings run from this file become a part of the default template for all user accounts that are created. I suggest that you only apply the most generic settings to the Default User account.

Here is a sample of how to write commands in the CMDLINES.TXT file:

"regedt32 /s AdminStartMenuIcons.reg"
"setup.msi /qb!"

The CMDLINES.TXT has to start off with [COMMANDS]. Each line has to have quotes around it. Some commands you may want to run require quotes, I suggest putting such commands into a BAT file. To make things easy, you should save all of the settings you want to run in the CMDLINES.TXT file in same folder (so, in the $OEM$ folder).

Sample Settings:

Here are the settings I use in the CMDLINES.TXT. I have found, that the best way to integrate settings into the install is to use registry keys. I use various methods to find registry keys, but it seems that he best method is to use your favorite search engine. If I want to find a setting, I will search, for example, for: "Disable Desktop cleanup wizard registry key". That should get you on the right path. On to the samples:

Start Menu Pinned Icons - I like to have my own icons in the Start Menu after an install. On your test computer, set up the Start Menu pinned icons up the way you want and then export the following registry key:


Start Menu Options: To capture your Start Menu settings, do the following: On a test computer right click on the Start Menu. Click on Properties. Click on the Start Menu tab. Then, click on the Customize button next to the description of the Start Menu. Now, start on the General tab and make all of the desired changes. When you are done, move to the Advanced tab. Carefully go through these settings. When you are all done, Export the following tree:


Note: The key you just exported also covers the some of the Windows Explorer Folder Options. You will probably want to set your folder options before you export the key.

Classic Control Panel: I really like the Classic Control Panel, use the following key to set it in your install:

Windows Registry Editor Version 5.00


Desktop Cleanup Wizard: Another annoyance I like to rid myself of is the Desktop Cleanup Wizard. Use the following key to turn it off:

Windows Registry Editor Version 5.00


Detail View: I really like the detail view in Windows Explorer, here is the key you need to include it:

Windows Registry Editor Version 5.00



Shortcut to: You know how when you create an icon on your desktop it always says "Shortcut to Firefox." I hate that, this key removes that annoyance:

Windows Registry Editor Version 5.00


Drive Letter First: This tweak is really handy for the average user. It makes the drive letter first in My Computer. Here it is:

Windows Registry Editor Version 5.00


Places Bar: Every user in our environment has a drive to save their stuff (the G: drive). I wanted to add it to the Places tab in explorer. Here is the registry key:

Windows Registry Editor Version 5.00


Here is what it looks like:

There are dozens of settings that you can use to customize the front end of Windows. If you do some good searching, you should be able to get Windows to "set itself up" while it is installing.


In this article we have discussed how to customize the "front end" of Windows. We talked about how to customize the part of Windows that the user will see. This is a huge time saver. Running registry files in the CMDLINES.TXT will set most settings you need. The great thing about this method is that every account created after this point has these settings.

Scripted OS Install - Part 4: Drivers

Scripted OS Install - Part 6: Tweaking Windows (Round 2)

Comments 1 CommentJump to latest comment

riva11's picture

Many compliments Trb48 for this fantastic and hepful documentation.

Login to vote