MD5: E0A8539117455E4CD71BBF9DEDCB9557
*ScriptPack Archive - 53.9KB
MD5: 1F1151EA4D86AFC98094B87DF32A4EFB
Note: This download contains the current and all previous ScriptPack releases minus the three anti-malware registry files.
Change Log
There is now an ongoing change log for all of the ScriptPack components here.
Introduction
If you have ever installed Windows XP SP2 straight from the CD that you received from Microsoft, then you probably realize that going about it from scratch can take up the better part of your day. If you are reading this, then you have probably already discovered RyanVM's Windows XP Post SP2 Update Pack, nLite, Bashrat the Sneaky's DriverPacks, XPize, WPI and maybe even have come up with a few tricks of your own. What I've discovered in the last several years are that there is always something that still needs to be done even when it's "done".
What I've tried to do with this collection of scripts is sew up some of the remaining holes in the process. This collection consists of VBscripts that I've put together over the last couple of years. Some of the code I came up with ages ago and have adapted it for public consumption. Some of the code is relatively new. Some of it I got from others and made only small modifications. Through this document, I will make every effort to link to where I found a specific set of code and give credit where it's due.
Included is a batch file, presetup.cmd, one VBscript for cmdlines.txt called cmdlines.vbs, the cmdlines.txt that launches cmdlines.vbs, and then several VBscripts for use during RunOnceEx. You don't need to know one thing about VBscript in order to use these either. All of the user defined settings are contained in one file, 500_Settings.ini. The filenames are such that they correspond with the RunOnceEx step number. I took this a little further and named files which are manipulated during a particular stage and gave them a similar prefix. For instance, the script 070_VMwareTools.vbs, which runs at the RunOnceEx stage 070, installs the VMware Tools by calling a switchless silent installer. So the filename of the switchless silent installer that the script calls is named 071_VMwareTools.exe. This way your \OEM directory will be full of files that are listed in the order which they are processed.
The scripts that come with the ScriptPack will always have a three digit RunOnceEx ID ending in 0. User defined and custom entries will have a three digit RunOnceEx ID ending with 5. This will become more apparant as you read about adding your own scripts and installers.
If you use AutoImage, you can place all of the ScriptPack files in the AutoImage\ScriptPack subdirectory. You do not need to copy over cmdlines.txt as AutoImage will generate that file for you. Within AutoImage you can configure the ScriptPack for individual installations and it will even prepare your install source with the appropriate directory structure and copy over your additional files for you. If you prefer not to use AutoImage, then you will need to manually configure the 500_Settings.ini file.
This entire set of scripts were designed to work with either a CD/DVD disc based install or a RIS based install. For RIS installations, all of the files need to be placed in the \$OEM$\$1 directory in your RIS image. If there is a particular script that you don't want to use, just leave it out. That's it. So if you don't want to be bothered with defragmenting your hard drive during the install, just omit the script(s) that perform that function.
Presetup.cmd
- Code: Select all
@Echo Off
Echo.
If Exist "%systemroot%\system32\setupold.exe" Del /F "%systemroot%\system32\setupold.exe"
Set TAG=\WIN51
For %%i In (C D E F G H I J K L M N O P Q R S T U V W X Y Z) Do If Exist "%%i:%TAG%" Set CdDrive=%%i:
If NOT DEFINED CdDrive Set CdDrive=%CD%\..\
Set OemDir=%CdDrive%\OEM
If NOT Exist "%OemDir%" FindFile "\OEM" OemDir "%CdDrive%"
Call :Presetup>"%SystemRoot%\presetup.log"
If NOT DEFINED DPDIR Goto :EOF
If NOT DEFINED WDSP Goto :EOF
"%SDP%" "%DPDIR%"
Start "" %WDSP%
Goto :EOF
Exit
:Presetup
@Call :FindFile "7z.exe" "s7z"
@Call :FindFile "un7zip.exe" "un7zip"
@Call :FindFile "DPsFnshr.ini" "DPsFnshr"
@Call :FindFile "DPsFnshr.7z" "DPsFnshr7z"
@Call :FindFile "DP*.7z" "DP"
@Call :FindFile "bin\*.7z" "bin7z"
@Call :FindFile "000_SR*.7z" "SR"
@Call :FindFile "000_SD*.7z" "SD"
@Call :FindFile "*.ins" "ins"
If DEFINED s7z @Call :CopyFile "%s7z%" "%SystemRoot%\system32\"
If DEFINED DPsFnshr @Call :CopyFile "%DPsFnshr%" "%SystemDrive%\"
If DEFINED ins @Call :CopyFile "%ins%" "%SystemDrive%\"
If DEFINED DPsFnshr7z @Call :unZip "%DPsFnshr7z%" "%SystemDrive%\"
If DEFINED bin7z @Call :unZip "%bin7z%" "%SystemDrive%\"
If DEFINED SR @Call :unZip "%SR%" "%SystemRoot%\"
If DEFINED SD @Call :unZip "%SD%" "%SystemDrive%\"
If DEFINED DP @Call :unZip "%DP%" "%SystemDrive%\"
@Call :FindFile "DevPath.exe" "SDP"
If Exist "%SystemDrive%\DSPdsblr.exe" Set WDSP=%SystemDrive%\DSPdsblr.exe
If NOT DEFINED WDSP If Exist "%SystemDrive%\WatchDSP.exe" Set WDSP=%SystemDrive%\WatchDSP.exe
@Call :FindFile "WatchDSP.exe" "WDSP"
@Call :FindFile "DSPdsblr.exe" "WDSP"
@Call :FindFile "D\*" "DPDIR"
Set
Goto :EOF
:unZip %1 %2
If DEFINED s7z Set unZip="%s7z%" x -y -aoa %1 -o%2
If DEFINED un7zip Set unZip="%un7zip%" %1 %2
@Echo Unzipping %1 to %2
If Exist %2 If Exist %1 %unZip%
If %ErrorLevel% GTR 0 @Echo: ...Could not extract!
Goto :EOF
:CopyFile %1 %2
If Exist %1 Copy /V /Y %1 "%~2\" 1>Nul
If NOT Exist "%~2\%~nx1" @Echo: ...File did not copy!
Goto :EOF
:FindFile %1 %2 %3
@REM * Call :FindFile "searchTerm" "OutputVariable"
@REM * Note: "searchTerm" may contain wildcards.
If [%3]==[] (
Echo Searching for ^<%~1^>
@Call :FindFile %1 %2 "%SystemDrive%"
If DEFINED %~2 Goto :EOF
@Call :FindFile %1 %2 "%OemDir%"
If DEFINED %~2 Goto :EOF
@Call :FindFile %1 %2 "%OemDir%\bin"
If DEFINED %~2 Goto :EOF
@Call :FindFile %1 %2 "%CdDrive%"
If DEFINED %~2 Goto :EOF
@Echo: ...File not found!
Goto :EOF
)
Pushd %3
If Exist "%~3\%~1" Set %~2=%~3\%~1
For /F "tokens=1 delims=" %%A In ('Dir /a-d /b /s "%~1" 2^>nul ^| FIND /C /V ""') Do Set Num=%%A
Set fType=unknown
If %Num% EQU 1 (Set fType=findFile)
If %Num% GTR 1 (Set fType=findDir)
If %Num% EQU 0 (
For /F "tokens=1 delims= " %%A In ('Dir /ad /s "%~1" 2^>nul ^| Find "Dir(s)"') Do (
If %%A GTR 1 (Set fType=dir)
)
)
Echo %1 | FindStr /L /I /C:"*" >Nul
If %ErrorLevel% EQU 0 Set fType=findDir
If [%fType%]==[findDir] (
If Exist "%~3\%~1" (
Set %~2=%~3\%~1
Goto :EOF
)
For /R "%CD%" %%A In (%~1) Do (
If Exist "%%~dpA\%~1" Set %~2=%%~dpA
Echo %1 | FindStr /L /I /C:"*" >Nul
If %ErrorLevel% EQU 0 Set %~2=%%~dpA\%~1
)
)
If [%fType%]==[findFile] (
For /R "%CD%" %%A In (%~1) Do (
If Exist "%%~A" Set %~2=%%~A
)
)
If [%fType%]==[dir] (
Set %~2=%CD%\%~1
)
Popd
Goto :EOF
This batch file is a drop in replacement for the batch used in a Method 2 installation of Bashrat the Sneaky's DriverPacks. This will work with either CD/DVD or RIS installs. I also added the ability to decompress two specific 7-Zip archive files, 000_SD*.7z (for decompressing to the %SystemDrive%) and 000_SR*.7z (for decompressing to the %SystemRoot%).
cmdlines.txt
Required For: cmdlines.vbs
- Code: Select all
[Commands]
"cscript cmdlines.vbs"
That's the whole thing. It simply calls upon CScript to launch the cmdlines.vbs script. Please note that WScript is not available from cmdlines.
cmdlines.vbs
Requires: cmdlines.txt
Required For: All subsequent scripts
This script, like all of the other scripts, will first determine if the working directory is the \OEM directory of your CD/DVD or the %SystemDrive% in the case of RIS. This determination is made by seeing where 500_Settings.ini is located. After that it checks to see what necessary files are available for use with RunOnceEx. The following files are switchless silent installers that I've made and the cmdlines.vbs script will automatically add them to the RunOnceEx sequence if they are found:
010_dotNET30.exe
010_dotNET30-Lite.exe
010_dotNET35.exe
010_dotNET35-Lite.exe
010_RogueSpearsRuntimesPart2.exe
*010_dotNET35SP1.exe
*010_dotNET35SP1-Lite.exe
*011_VSTO2008SP1.exe
*020_PaintNET.exe
*025_ProPhotoTools.exe
*030_Firefox.exe
040_WindowsDefender.exe
050_DAEMONTools.exe
* = Multimode installer
Windows Defender I am no longer maintaining or distributing, though if you find an installer from someone else you could rename it accordingly use it with this script. The other files you can download as ScriptPack Addons in the Releases forum. A ScriptPack Addon is as simple as it gets in terms of addons - it simply copies the switchless silent installer file over to your \OEM directory. That's it. This script will find the file in the \OEM directory ($OEM$\$1 in the case of RIS) and schedule a RunOnceEx event for the installer.
Starting with version 1.07 of this script, support for xehqter's OEMScan utility has been added. If you use my ScriptPack OEMScan Addons to add Royalty OEM pre-activation support, the cmdlines.vbs script will automatically launch OEMScan for you during the cmdlines stage of setup. For more details on how all of this works, please refer to the ScriptPack OEMScan Addons thread.
- Code: Select all
[cmdlines]
CompressThreshold=10
CopySourceThreshold=40
Custom005Title=
Custom005File=
Custom005Args=
Custom015Title=Some Application
Custom015File=filename.exe
Custom015Args=/verysilent
Custom135Title=Student and Streets
Custom135File=135_Student-Streets.vbs
Custom135Args=
Custom145Title=Create Shortcuts
Custom145File=145_CreateShrtcuts.vbs
Custom145Args=
DL1Name=ActiveX.7z
DL1URL=http://www.DoITRightConsulting.net/files/ActiveX.7z
DL2Name=Cookies.7z
DL2URL=http://www.DoITRightConsulting.net/files/Cookies.7z
DL3Name=RestrictedDomains.7z
DL3URL=http://www.DoITRightConsulting.net/files/RestrictedDomains.7z
DL4Name=TrustedDomains.7z
DL4URL=
LogonDomain=%computername%
LogonPassword=password
LogonUserName=Administrator
CompressThreshold and CopySourceThreshold
These values represent gigabytes. The CompressThreshold value as shown above, will enable the RunOnceEx script 120_Compress.vbs to run if the %SystemDrive% is found to be 10GB or less. The CopySourceThrehold value as shown, will enable the 110_CopySource.vbs script to run if the %SystemDrive% is found to be 40GB or larger.
CustomxxxTitle, CustomxxxFile, CustomxxxArgs
These entries are where you can define your custom installs or scripts. The Title is what will appear in the RunOnceEx window for that particular entry. The File entry is for the filename alone - no path should be included. The Args entry is for any command line arguments that the file may need. Some example entries above reflect the two sample custom scripts that I have included in the ScriptPack download and one entry is for a totally ficticious application, but it illustrates the proper use of the Args entry.
DLxName and DLxURL
These entries allow you to specify up to four registry files archived with 7-Zip for download and merging into the registry. The 7-Zip files will be downloaded, decompressed, and then merged into the registry. Finally, all of the .7Z and .reg files will be deleted. Even if no URL is specified, the script will still look for the presence of whatever file is listed in the Name entry. As an example - you could have DL1Name listed as above, ActiveX.7z, but have no corresponding URL. You could then place in your install source the ActiveX.7z file or even decompress it and use ActiveX.reg instead. The script will import the registry either way. You could even put ActiveX.7z in your source and also specify a URL to download from. That way if your computer has an Internet connection it will download the file and use it, which will likely be more recent than what you have on your source. But, if for some reason you don't have an Internet connection, at least you will get something.
The first three files are currently available and you can leave the entries as they are if you would like to use them. The fourth entry, TrustedDomains.7z, I will not host as that could potentially lead to a lot of problems. If for instance you wanted to download the first and third files only, remove the values for DL2Name and DL2URL. The registry entries in these files represent a combination of the most recent entries made by Advanced Windows Care, Spybot S&D and SpywareBlaster. Lastly, you can place a registry file named cmdlines.reg in $OEM$ and it will be merged as well. Or to take it one step further, you could compress cmdlines.reg to cmdlines.7z and that will automatically be decompressed and merged. Please note that the code for downloading files was adapted from a script example found here.
LogonDomain, LogonPassword, and LogonUserName
These entries are where you define the AutoLogon account information. If you are not going to be using a domain account, then leave the LogonDomain entry as %computername%.
060_VPN.vbs
Requires: cmdlines.vbs
This script will determine the chassis type of the computer it is running on and based on what type it is, it will execute up to two installers.
- Code: Select all
[VPN]
Installer1=
Installer2=
Other=False
Unknown=False
Desktop=False
LowProfileDesktop=False
PizzaBox=False
MiniTower=False
Tower=False
Portable=True
Laptop=True
Notebook=True
Handheld=True
DockingStation=True
AllInOne=False
SubNotebook=True
SpaceSaving=False
LunchBox=False
MainSystemChassis=False
ExpansionChassis=False
SubChassis=False
BusExpansionChassis=False
PeripheralChassis=False
StorageChassis=False
RackMountChassis=False
SealedCasePC=False
Installer1 and Installer2
These represent the filenames of your installers that you want to run based on the conditions set. You can download the installer I made for the Sierra Wireless AirCard 555, but I am unable to provide the Cisco VPN Client installer due to licensing and strong encryption export restrictions. So long as the installers are in the \OEM directory of your CD or on the system drive in the case of RIS, they will be found and installed.
061_AirCard.exe - 2.30MB
MD5: 5F30597CF0CDD48EE46EF92AF334BC5C
Desktop, Notebook, etc.
These are the chassis types recognized by Windows Management Instrumentation (WMI). Please be advised that not all computer and laptop manufacturers properly adhere to these values - particularly a lot of "no name" brands. This script has so far worked for me on Dell, HP-Compaq, and Toshiba laptops. Your mileage may vary.
070_VMwareTools.vbs
Requires: cmdlines.vbs
This script will determine, via WMI, whether or not the "computer" that you are running your install on is actually a VMware virtual machine. It does this by checking the appropriate BIOS string where VMware had populated the field with their company name. If it is determined to be a virtual machine, the script will execute a switchless silent installer, 071_VMwareTools.exe, that installs the VMware Tools. The script does not have any entries in 500_Settings.ini.
This script is no longer necessary if the only possible virtualizing software that you will find yourself using is VMware Workstation. My latest switchless silent installer for the VMware Tools is now svcpack compatible and can be downloaded in the Releases forum.
080_KTD.vbs
Requires: cmdlines.vbs
- Code: Select all
[KTD]
SourceDir=%SystemDrive%\D
DestinationDir=%SystemRoot%\D
CompressFiles=True
This script will selectively keep device drivers from Bashrat the Sneaky's DriverPacks and register the path in the registry. You must have the DriverPack 7-Zip archive files decompressed either as a normal part of a Method 2 install, or you can use the directory created by a Method 1 slipstream. This script depends on DevPath.exe which must be located either in %SystemDrive%, %SystemDrive%\bin or in the \OEM\bin directory of your CD/DVD install source. Note: I have run into a problem with this script failing when Symantec AntiVirus is installed from Group Policy. The problem is that SAV is performing it's initial virus scan and has a lock on some of the files, so any move or delete operations will fail. The solution is to configure your GRC.DAT file so that SAV will not initiate a full scan when the GRC.DAT file is processed. This can be done for either GPO or switchless silent installers. Use the Symantec provided utility - ConfigEd - found in the Tools directory of your distribution media.
SourceDir and DestinationDir
These entries are critical to the proper execution of the script. If you enter the path improperly, the script won't go hunting around to find your driver directory. The SourceDir value must begin with either %SystemDrive%, %systemRoot%, or %cdrom%. The DestinationDir value must begin with either %SystemDrive% or %SystemRoot%. Whatever you put in after that is up to you, just so long as it actually reflects where your source really is (or will be). You can make the SourceDir and DestinationDir values the same.
CompressFiles=True
This entry indicates whether or not you want to cab (with makecab.exe) the compressable files within the drivers. I've found that this saves a considerable amount of space and institues an imperceptable performance penalty when your computer finds a new device.
[KTD-List]
- Code: Select all
[KTD-List]
;Chipset
C
;CPU
CPU
;Graphics
G
;Lan
L\AD
L\AU ...etc.
100_Cleanup.vbs
Requires: cmdlines.vbs
The first thing that is done is determing if two 7-Zip archives are present in the working directory. If 101_AllUsers.7z is found, it will be decompressed to %AllUsersProfile%. In some circumstances I like to throw in some shortcuts to Start Menu or the Desktop folders and this is an easy way to do that without getting into making addons, etc. If 101_ProgFiles.7z is found, it will be decompressed to %ProgramFiles%. The same could be said for Program Files - sometimes it's just easy enough to decompress some applications directly if they don't require any registry entries.
Second, if a registry file named 101_Registry.reg is found, it will be merged. Some registry entries take just fine at cmdlines and yet others require that they are imported after Windows setup has completely finished. I usually make one single registry tweak file, cmdlines.reg, and make a duplicate - 101_Registry.reg. This way they should all import no matter what.
The first cleanup performed looks for files in the root of %SystemDrive% to delete in the event of a RIS based install. These would be the switchless silent installers starting with 010_dotNET30.exe and so on. So, let's get into the settings.
- Code: Select all
[Cleanup]
CleanAllUsersStartMenu=True
CleanUserStartMenu=True
DelMSUpdate=True
DelWindowsCatalog=True
DelSetPrograms=True
DelMovieMaker=True
DelAccAccessibility=True
DelAccCommunications=True
DelAccEntertainment=True
DelAccSystemTools=True
RestrictStartMenu=True
Folder0=Hardware
Folder1=Security
Folder2=Utilities
Folder3=
CleanDefaultUser=True
CleanLogFiles=True
All but the last two entries have to do with the Start Menu. All of the entries beginning with "Del" indicate shortcuts or subfolders of \Accessories that are to be deleted from the All Users Start Menu and they are dependant on the CleanAllUsersStartMenu entry. The CleanUserStartMenu entry when enabled deletes all shortcuts and the Accessories subfolder from the User Start Menu. This will not prevent creation of shortcuts to the User Start Menu from the registry (ex: \Accessories\Address Book).
RestrictStartMenu, Folder0, etc.
These entries are the names of subfolders in the All Users Start Menu that you would like to lock down so that only administrators can view the contents. An annoying aspect to this is that restricted users can still see the subfolders in the Start Menu, even though they can't see any of the shortcuts. You may define up to ten (10) folder names to restrict (0 thru 9). In order for the Folderx entries to be processed, RestrictStartMenu must be set to True.
CleanDefaultUser
When this is set to True, the following directories are deleted from the Default User profile: Desktop, My Documents, NetHood, PrintHood, Recent, Start Menu, and Templates. This is strictly personal preference, but I prefer that the only thing that is derived from the Default User profile, be the registry. I like to place shortcuts, etc in the All Users profile so I know that they will be there for everyone.
CleanLogFiles
When this is set to True, all of the .log files in %SystemRoot% are compressed to a 7-Zip archive called SetupLogFile.7z. They are then deleted along with any extraneous %SystemRoot%\*.tmp files. This is especially helpful when you integrate some sort of cleanup utility like CCleaner into your installation. CCleaner will wipe out a good deal of .log files before you even get a chance to look at them. This way all of them, and in their original state, are retained for later viewing.
110_CopySource.vbs
Requires: cmdlines.vbs
- Code: Select all
[CopySource]
Other=False
Unknown=False
Desktop=False
LowProfileDesktop=False
PizzaBox=False
MiniTower=False
Tower=False
Portable=True
Laptop=True
Notebook=True
Handheld=True
DockingStation=True
AllInOne=False
SubNotebook=True
SpaceSaving=False
LunchBox=False
MainSystemChassis=False
ExpansionChassis=False
SubChassis=False
BusExpansionChassis=False
PeripheralChassis=False
StorageChassis=False
RackMountChassis=False
SealedCasePC=False
This script will be registered into the RunOnceEx sequence based on the size of your hard drive relative to the value entered for CopySourceThreshold (see the [cmdlines] section). When the script does run, it will first check to see if the computer is of the proper chassis type. This feature was added to the script at the suggestion of MSFN member Cluberti as a way implementing the script for RIS installs. The script will copy the source i386 directory to %SystemRoot%\i386 and register the location. All executable files in the svcpack directory are deleted from the local source.
120_Compress.vbs
Requires: cmdlines.vbs
This script will be registered into the RunOnceEx sequence based on the size of your hard drive relative to the value entered for CompressThreshold (see the [cmdlines] section). Directories that are not often accessed in %SystemRoot% and %ProgramFiles% are compressed using NTFS compression. This yields a pretty modest space savings, but with so many laptops hobbled with 30GB (or less) hard drives, I like to get all the space I can.
150_DefragHD.vbs
Requires: cmdlines.vbs
This script will defragment the hard drive(s). It will look to see if Diskeeper, O&O Defrag or PerfectDisk are installed and if one of them is it will be used instead of Windows Defrag. For offline defrags without PerfectDisk, SysInternal's PageDefrag is utilized. Due to licensing restrictions, I am unable to supply this freeware title with the distribution of these scripts. You can download it from SysInternals directly at here. If you want to use PageDefrag, make sure that it's executable file is somewhere in the system path.
- Code: Select all
[DefragHD]
OfflineDefrag=False
The OfflineDefrag setting is a simple True or False. It probably doesn't warrant any further explanation than that.
160_ConfigPageFile.vbs
Requires: cmdlines.vbs
- Code: Select all
[ConfigPageFile]
SizeRelativeToRAM=2
The sole purpose of this script is to set your page file to a static size. By default, the size is set to two times the amount of physical RAM you have in your computer. A value between 1 and 32 will act as a multiplier. Any value above 32 will be treated as literal. Examples:
This will set your page file to three times the amount of RAM in your system. If you have 2GB, this would equal a 6GB page file which is invalid. Therefore your page file will be set at 4092MB.
- Code: Select all
SizeRelativeToRAM=3
This will set your page file to be 1GB in size.
- Code: Select all
SizeRelativeToRAM=1024
This is invalid and your page file will be set at 4092MB.
- Code: Select all
SizeRelativeToRAM=5120
170_ConfigAccounts.vbs
Requires: cmdlines.vbs and optionally 999_Email.vbs
Almost all of the functions in this script are optional and/or configurable. With everything set to True here is what happens: The built-in Administrator account is renamed, disabled, description deleted, and joined to the Guests local group. The built-in Guest account is renamed and the description deleted. A fake Administrator account is created, complete with the default description, joined to the local Guest group and set to disabled. The user registry for the currently logged in user is exported to the Default User profile. A fellow on MSFN with the screen name of BoaSoft gave me the idea for the code to copy the current HKCU to the Default User profile. The original thread is here.
- Code: Select all
[ConfigAccounts]
BuiltinAdminName=Jerry
BuiltinGuestName=Kramer
DelASPNET=True
DelHelpAssistant=True
DelSUPPORT=True
FakeAdmin=True
LogonDomain=%computername%
LogonPassword=password
LogonUserName=Administrator
ProcessAdmin=True
ProcessGuest=True
UseNameSettings=True
EmailNotification=True
EmailSubject="%computername% is waiting for input"
EmailBody="Waiting"
BuiltinAdminName and BuiltinGuestName
These entries simply change the name of the two built-in accounts. Considering that the PID for either account will not change, it's usefullness as a security measure is questionable at best, but you can change them here as you see fit.
DelASPNET, DelHelpAssistant, and DelSUPPORT
I have yet to find a real reason to keep these accounts enabled. Luckily you can just delete them by setting these entries to True.
FakeAdmin
This will create a fake Administrator account, complete with the default description. Again, the real usefullness of this is questionable, but if some sort of unwanted software decides to try and hack away at an account named "Administrator", then it can go to town all day long on this one. The fake account is disabled by default and is a member of the Guests group.
LogonDomain, LogonPassword, and ProcessGuest
The script will now take on of two branches of execution. If it finds a file named 171_NameSettings.hta, it will execute that file which brings up a simple interface asking you to enter in the user name, full name, and password (w/ confirm) of an Administrative User and a Restricted User. Additionally you are asked to give the computer a name. This is nice since you can put whatever want in your WINNT.SIF file and use the same source on multiple computers. The AutoLogon entries will be populated with credentials of whatever you enter for the Administrative User. This option is really meant for computers that are not domain members, but it will work regardless. Removing Internet Explorer from your install may prevent the .hta file from executing.
The other branch of execution is a simple subroutine and will execute if 171_NameSettings.hta is not found or UseNameSettings is set to False. You need to configure the three entries that begin with Logon if you want the computer to AutoLogon and complete the second series of RunOnceEx entries. This option can be used for computers that are either domain or workgroup members.
ProcessAdmin and ProcessGuest
These two entries must be set to True for the built-in Administrator and Guests accounts to be renamed, disabled, etc.
UseNameSettings
With this setting you can disable the execution of 171_NameSettings.hta even if it is present. Previously 171_NameSettings.hta would run no matter what if it was found. This setting was added mainly for ease of configuration with AutoImage.
EmailNotification, EmailSubject, EmailBody
If you would like to have an email notification sent to you when this script runs, then set EmailNotification to True. The default settings here reflect that the notification takes place just before the 171_NameSettings.hta application runs. That screen will remain indefinately waiting for your input before carrying on with the installation. So this email notification can be convenient, especially when sent to an email address linked to a cell phone, to notify you that the computer is waiting for required user action.
190_SetNextBoot.vbs
Requires: cmdlines.vbs
Required For: All subsequent scripts
- Code: Select all
[SetNextBoot]
Custom215Title=
Custom215File=
Custom215Args=
Custom225Title=
Custom225File=
Custom225Args=
Custom235Title=
Custom235File=
Custom235Args=
Custom245Title=
Custom245File=
Custom245Args=
DefragRegistry=False
Just like with cmdlines.vbs, this script populates the RunOnceEx registry entries based on what scripts it finds available. You can specify up to four custome scripts or executables to run. The syntax for defining your custom RunOnceEx entries is the same as with cmdlines.vbs.
DefragRegistry
The script will then optionally defragment the registry using NTRegOpt and then reboot. NTRegOpt can be downloaded here. Just make sure it's couple of files are within your system's path. I usually put it in %SystemRoot%\System32. If this option is set to False, a reboot will be initiated using shutdown.exe (w/ a two minute delay).
200_ConfigNetwork.vbs
Requires: 190_SetNextBoot.vbs
- Code: Select all
[ConfigNetwork]
ConnectionName=Local Area Connection
ShowTrayIcon=True
Domain=
NetBIOS=False
SetSpeed=True
This script performs a few common network configuration chores. It will enable the tray icon for your primary (wired) network connection, rename the connection from "Local Area Connection" to a name of your chosing, hardcode a DNS suffix for your primary connection (this is the box in Advanced TCP/IP settings, DNS Tab, towards the bottom), turn off NetBIOS for ALL network connections, and set your wired connection to a fixed 100-Full Duplex. Thanks to MSFN member Cluberti for pointing me to this thread. I adapted code from there for the speed and duplex routine.
A couple of notes. I have this script run in the second round of RunOnceEx because the Cisco VPN Client needs a reboot before it's virtual NIC can be enumerated and installed. I think the same goes for VMware Workstation (though I always install that from svcpack.inf anyway), but by running it after the second reboot I am sure that NetBIOS will be disabled from any and all NICs. If you want to rename the primary connection and set a DNS suffix, you must set ShowTrayIcon to Yes.
250_FinalDefrag.vbs
Requires: 190_SetNextBoot.vbs
- Code: Select all
[FinalDefrag]
OfflineDefrag=False
See the description for 150_DefragHD.vbs. I like to run a second hard disk defrag because with PerfecDisk at least, it doesn't seem to collect the boot optimizing information until the reboot after the first RunOnceEx scripts run.
300_Final.vbs
Requires: 190_SetNextBoot.vbs and optionally 999_Email.vbs
- Code: Select all
[Final]
DefragRegistry=False
EmailNotification=True
EmailSubject="Installation of %computername% is finished"
EmailBody="Waiting"
This script simply clears out the AutoLogon registry entries, deletes any left over script files it finds, optionally sends an email notification, and then reboots the computer. There is an option which selects whether or not to use NTregOpt to defragment the registry, which will itself initiate a system reboot.
EmailNotification, EmailSubject, EmailBody
If you would like to have an email notification sent to you when this script runs, then set EmailNotification to True. The default settings here reflect that the notification takes place just before the final reboot takes place. This notification is meant to inform the user that the computer installation has completed.
999_Email.vbs
- Code: Select all
[EmailSettings]
From=
To=
SMTPserver=
SMTPport=25
Authenticate=0
Username=
Password=
UseSSL=False
Timeout=60
This script must be included with the others if you'd like to use the email notification options. The above settings must be set in order for the script to know how to send out the email. I have tested this procedure on several dozen installs using plain POP3 with unsecured unauthenticated SMTP, Gmail which uses secure authenticated SMTP, and with a Microsoft Exchange server - all successfully. The settings are critical however, and this feature will not work with improper settings. Please note that in cases where authentication is needed, your password will be in the 500_Settings.ini file unencrypted and plain for all to see. I would suggest either using an insecure SMTP relay, which are becoming harder to find these days, or obtain a completely disposable email account where the security is inconsequential.
If you're having difficulties getting the email functionality to work, please refer to my E-Mail Testing Tool to troubleshoot your settings.
SMTPserver
Either an IP address or a fully qualified domain name (FQDN) will work here. On my internal network I just put in the IP address and it works fine.
SMTPportp
The default is 25 and that should work a majority of the time. Use port 465 for Gmail.
Authenticate
There are three valid values for this entry - 0, 1, and 2. 0 indicates no authentication at all. 1 is basic or clear text authentication, which is used by Gmail. 2 is NTLM authentication used by Microsoft Exchange Server. Don't let the clear text authentication scare you away. Even though Gmail uses it, the authentication is done over SSL.
Username and Password
These are necessary for when SMTP authentication is required.
UseSSL
Either True or False. For Gmail set this to True.
Timeout
How long the script will attempt to send the email in seconds. The default of 60 seconds should be fine almost all of the time.

