Video Screencast Help

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.

Users:

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:

[COMMANDS]
"regedt32 /s AdminStartMenuIcons.reg"
"file.bat"
"file.cmd"
"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:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage

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:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

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

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"ForceClassicControlPanel"=dword:00000001

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

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\CleanupWiz]
"NoRun"=dword:00000001

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

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Defaults]
"{20D04FE0-3AEA-1069-A2D8-08002B30309D}"=hex:1c,00,00,00,04,00,00,00,00,00,00,00,00,00,9a,00,00,00,00,00,01,00,00,00,ff,ff,ff,ff,f0,f0,f0,f0,14,00,03,00,9a,00,00,00,00,00,00,00,30,00,00,00,fd,df,df,fd,0f,00,05,00,24,00,10,00,2e,00,46,00,00,00,00,00,01,00,00,00,02,00,00,00,03,00,00,00,04,00,00,00,78,00,96,00,60,00,60,00,78,00,00,00,00,00,01,00,00,00,02,00,00,00,03,00,00,00,05,00,00,00,ff,ff,ff,ff,cf,f3,a8,b0,33,43,ab,4b,88,73,1c,cb,1c,ad,a4,8b,30,f1,25,b7,ef,47,1a,10,a5,f1,02,60,8c,9e,eb,ac,04,00,00,00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams]
"Settings"=hex:08,00,00,00,04,00,00,00,00,00,00,00,00,77,7e,13,73,35,cf,11,ae,69,08,00,2b,2e,12,62,04,00,00,00,03,00,00,00,43,00,00,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

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
"link"=hex:00,00,00,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

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"ShowDriveLettersFirst"=dword:00000004

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

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\comdlg32\PlacesBar]
"Place0"=dword:00000000
"Place1"=dword:00000011
"Place2"="G:\\"

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.

Conclusion:

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.

+1
Login to vote