Jump to content

Gosh's Unattended Tips And Tricks


Recommended Posts

Here's some stuff useful for an unattended install. Most of the stuff is rare or unique. Enjoy.

Trick #1: Make a flat.

Close your eyes and imagine this for a second. You've made an unattended cd. A friend of yours who is computer illiterate calls you and has a problem with his computer. It hits you that you could save time by running your unattended cd at his house, doing a quick clean install. So you go over to his house, backup his data, and run your unattended cd. Once done you leave with the unattended cd. The next day your friend calls you up. This time he needs your xp cd because he installed something like IIS, and it needs files from the CD. Now you have to drive all the way over to his house again, just to give him your cd. Wouldn't it be nice if an unattended cd not just installed your favorite programs, but copied itself to the hard drive? That way you wouldn't need the cd again.

To make an unattended flat we're gonna need to make 2 files - source.bat and source.reg. We're gonna put both into the windows folder.

First, make this folder:

\$OEM$\$$

Copy what's below and save it as \$OEM$\$$\source.bat

@ECHO OFF

IF EXIST C:\WIN51IP.SP1 set CDROM=C:

IF EXIST D:\WIN51IP.SP1 set CDROM=D:

IF EXIST E:\WIN51IP.SP1 set CDROM=E:

IF EXIST F:\WIN51IP.SP1 set CDROM=F:

IF EXIST G:\WIN51IP.SP1 set CDROM=G:

IF EXIST H:\WIN51IP.SP1 set CDROM=H:

IF EXIST I:\WIN51IP.SP1 set CDROM=I:

IF EXIST J:\WIN51IP.SP1 set CDROM=J:

IF EXIST K:\WIN51IP.SP1 set CDROM=K:

IF EXIST L:\WIN51IP.SP1 set CDROM=L:

IF EXIST M:\WIN51IP.SP1 set CDROM=M:

IF EXIST N:\WIN51IP.SP1 set CDROM=N:

IF EXIST O:\WIN51IP.SP1 set CDROM=O:

IF EXIST P:\WIN51IP.SP1 set CDROM=P:

IF EXIST Q:\WIN51IP.SP1 set CDROM=Q:

IF EXIST R:\WIN51IP.SP1 set CDROM=R:

IF EXIST S:\WIN51IP.SP1 set CDROM=S:

IF EXIST T:\WIN51IP.SP1 set CDROM=T:

IF EXIST U:\WIN51IP.SP1 set CDROM=U:

IF EXIST V:\WIN51IP.SP1 set CDROM=V:

IF EXIST W:\WIN51IP.SP1 set CDROM=W:

IF EXIST X:\WIN51IP.SP1 set CDROM=X:

IF EXIST Y:\WIN51IP.SP1 set CDROM=Y:

IF EXIST Z:\WIN51IP.SP1 set CDROM=Z:

ECHO Please wait, Recovery Console is being installed locally.

%CDROM%\i386\winnt32.exe /dudisable /cmdcons /unattend

md %systemroot%\Source\i386

ECHO Please wait, source files are being copied.  This may take several minutes.

xcopy /Y /e %CDROM%\i386\*.* %systemroot%\Source\i386\

ECHO Adding registry entries.

regedit.exe /s Source.reg

ECHO Done.

exit

Copy what's below and save it as $OEM$\$$\source.reg
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]

"SourcePath"="%systemroot%\\Source\\"

"ServicePackSourcePath"="%systemroot%\\Source\\"

Now, in your unattend file, make sure you have this:

[unattended]    UnattendMode=FullUnattended

    OemPreinstall=Yes

    OemSkipEula=Yes

[GuiRunOnce]

Command0="%windir%\source.bat"

That's it. When you install xp using the unattend file, recovery console and a flat will be made the first time you boot into windows. This is great for friends that don't have a clue about windows. Now when they call you for help you'll know they have recovery console installed locally and a flat locally.

Trick #2: Brand the my computer window:

You can put a custom logo and name in the my computer window by using a simple inf file and bmp.

First, make this folder:

\$OEM$\$$\System32

In this folder, copy below and save as \$OEM$\$$\System32\oeminfo.ini

[Version]Microsoft Windows Whistler Edition

WinVer=5.01

[General]

Manufacturer=gosh

Model=

[support Information]

Line1="win2k build"

Find a small .bmp and save it as \$OEM$\$$\System32\oemlogo.bmp

Make sure your unattend file has the stuff listed in trick #1. That's it.

Trick #3: Associate file types:

One of the most annoying aspects about xp is how some file types aren't registered the way you want it. For example, most software is released with an .nfo file, but xp wants to open .nfo files in msinfo32. Below is a way to batch file associations:

REM ftype will also show all registered types

assoc .blt=txtfile

assoc .cue=txtfile

assoc .diz=txtfile

assoc .eml=txtfile

assoc .iss=txtfile

assoc .log=txtfile

assoc .md5=txtfile

assoc .m3u=txtfile

assoc .nbi=txtfile

assoc .nfo=txtfile

assoc .nt=txtfile

assoc .pif=txtfile

assoc .sam=txtfile

assoc .sif=txtfile

assoc .sfv=txtfile

assoc *=txtfile

If you run those commands in a batch file, all the extensions will be registered as text files. This is also a good idea for security purposes, disabling known hostile file types such as .eml and .vbs

Tip #1: make a log file:

Unattended installs can be hard to troubleshoot. What i like to do is make a log file, which makes it easier to see where the problem is. To make a log file, have each command end in >> logfile.txt

An example from my current apps.bat file:

@ECHO OFF

ECHO Apps.bat, version %cdver% >> %windir%\apps.log

ECHO Logging started:  %date% %time% >> %windir%\apps.log

ECHO Computer:  %computername >> %windir%\apps.log

ECHO User:  %username% >> %windir%\apps.log

@echo.  >> %windir%\apps.log

@echo.  >> %windir%\apps.log

This will log information to apps.log.

Trick #3: Disable that stupid xp search companion:

Like the old win2k search? Bring it back!

REM Disable search companion

regsvr32 /u /s %windir%\srchasst\srchui.dll

Tip #2: Copy your favorite files to the install:

Using an oempreinstall you can copy files to your install, such as:

$OEM$\$$\Web\Wallpaper - put wallpapers here

$OEM$\$$\System32 - put screensavers, files such as cdimage.exe and cdburn.exe here

$OEM$\$$\Resources\Themes - put themes here. To specify default them make a .theme file and specify it in unattend file.

Tip #3: Use the server2003 classic accounts:

Copy keymgr.cpl from server2003 to your system32 folder to have classic accounts

Trick #4: Show classic user accounts in control panel.

To see the win2k user accounts window type control userpasswords2. To enable this in an unattended install, import this registry file:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ControlPanel\NameSpace\{7A9D77BD-5403-11d2-8785-2E0420524153}]

@="OldUserAccounts"

That's it for now. Let me know if you enjoy my tips and tricks.

-gosh

Link to comment
Share on other sites


I realize that you can add different wallpapers to show up on the desktop tab by placing them in the $$\Web\Wallpaper dir, but how do you set one to be default, instead of Microsoft's bliss.bmp (the one with the grassy hills) ?

Link to comment
Share on other sites

rename a copy of luna.theme in windows\resources\themes, edit it with notepad, copy it to $$\resources\themes and add this in winnt.sif

[shell]

CustomDefaultThemeFile="%Systemroot%\Resources\Themes\filename.Theme"

change filename to whatever you called it

Link to comment
Share on other sites

Great work !

Fine tune the batch 'source.bat' :

add a line:

'bootcfg /Timeout 2'

to reduce the boot time from 30 to 2 sec.

and make sure you have in i386 the folders WINNTUPG and COMPDATA

otherwise the installation of cmdcons fails.

Link to comment
Share on other sites

I realize that you can add different wallpapers to show up on the desktop tab by placing them in the $$\Web\Wallpaper dir, but how do you set one to be default, instead of Microsoft's bliss.bmp (the one with the grassy hills) ?

I just add my fav. wallpaper(s) to \$oem$\$$\Web\Wallpaper\ in .bmp format, then use a couple of reg. hacks to make it the default, i.e.:

[HKEY_CURRENT_USER\Control Panel\Desktop]

"ConvertedWallpaper"="C:\\WINDOWS\\Web\\Wallpaper\\Windows XP.jpg"

"Wallpaper"="C:\\WINDOWS\\Web\\Wallpaper\\Windows XP.bmp"

Works like a charm :)

Link to comment
Share on other sites

I used a simpler approach to get my Favourite Wallpaper installed as Default...

All I did was rename my Favourite Wallpaper to BLISS.JPG, then in command promp, in the directory of my file, I typed:

makecab BLISS.JPG BLISS.JP_

Then I replaced my old BLISS.JP_ in the I386 Directory of my installation CD with my new BLISS.JP_

Simple, but equally effective.

:)

Link to comment
Share on other sites

To specify default them make a .theme file and specify it in unattend file.

How would one go about chaning a .msstyles file to a .theme ? Is it as simple as just renmaing the file with the new extention, or does somethign more difficult need to be done?

Link to comment
Share on other sites

change this section in your theme file

[VisualStyles]

Path=%ResourceDir%\Themes\Cbfield\Cbfield.msstyles

ColorStyle=NormalColor

Size=NormalSize

there are regkeys too but theyre not essential

i would recommend changing this key for a classic login and shutdown theme

HKU,.DEFAULT\Software\Microsoft\Windows\CurrentVersion\ThemeManager,DllName,0x20000,"%windir%\resources\themes\Cbfield\Cbfield.msstyles"

edit :: or add it if it dont exist

Link to comment
Share on other sites

For some reason, when i use that method, it doesnt import the .msstyles properly. In the preview window, everything is out of preportion, and arent the right colours, yet when i apply the actual theme, it changes it to the classic theme (win2k)

Any suggestions why it might not be working properly?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...