ScriptPack v1.5.1.0 [20081013]

Releases, guides, changelogs, support and discussion of The ScriptPack. User created scripts and utilities.

Moderators: Waldo2k2, RogueSpear

ScriptPack v1.5.1.0 [20081013]

Postby RogueSpear » Sun Jul 09, 2006 10:46 pm

ScriptPack V1.5.1.0 - 761KB
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.
At the very bottom of 500_Settings.ini is a list of directories that you do NOT want to keep. The default list that I created will remove drivers that do not support devices based on USB, FireWire, or PCMCIA. The logic is that we don't add PCI cards that frequently, but plug in hot devices all the time. Feel free to modify this list as you see fit.


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.
Last edited by RogueSpear on Mon Jan 28, 2008 9:40 am, edited 16 times in total.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Version 1.01

Postby RogueSpear » Tue Aug 08, 2006 12:05 pm

Version 1.01 - 04/09/2006
  • cmdlines.vbs - There was a typo involving the RunOnceEx registry entries for custom script entries at the 140 level. Fixed.
  • 110_CopySource.vbs - The source path was being registered as %systemroot%\i386 instead of %systemroot%. To work properly the entry needs to read up to but not including the i386 folder. Also, there were two registry entries for the source path that I was not populating. Both problems fixed.
  • Thank you to MSFN member Moonlight Sonata for pointing out both errors and providing working fixes. Talk about service :D
  • Each script will contain a change log at the very bottom, after all code. This will hopefully make for better tracking of changes.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Version 1.02

Postby RogueSpear » Tue Aug 08, 2006 12:05 pm

Version 1.02 - 04/11/2006
  • presetup.cmd - Wildcards implemented for dealing with 000_SDrive.7z and 000_SRoot.7z files. This way you can have multiple files of each, for instance differentiating between work sites. Ex: 000_SDrive-CompanyA.7z or 000_SDrive-Home.7z.
  • cmdlines.vbs v1.02 - AutoLogon entries in workgroup and domain situations not working for some users. Both issues fixed.
  • 100_Cleanup.vbs v1.01 - Start Menu cleanup has been broken up between All Users and the User Start Menu. The All User Start Menu cleanup routine is now highly customizable from 500_Settings.ini. Restricting certain Start Menu folders to Admin only access will now accept up to 10 custom folder names and is now seperate from the Start Menu cleanup routine.
  • 170_ConfigAccounts.vbs v1.01 - Same issues as cmdlines.vbs.
  • 171_NameSettings.hta v1.01 - Same issues as cmdlines.vbs.
  • 200_ConfigNetwork.vbs v1.01 - I discovered that not all NICs populate the registry entry for ComponentID the same way. The NIC detection code has been modified to properly detect all NICs. This change required changes to 500_Settings.ini. Also, support for two more NICs added.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Version 1.03

Postby RogueSpear » Tue Aug 08, 2006 12:06 pm

Version 1.03 - 07/11/2006
  • All - All 500_Settings.ini entries that previously accepted values of "Yes" or "No" will now only accept values of "True" or "False" in order to be compatible with AutoImage.
  • All - Change to naming convention. Built-in ScriptPack scripts number assignments will end with zero (0) and custom / user scripts number assignment will end with five (5).
  • presetup.cmd and 090_KTD.vbs v1.02 - The following changes were made to maintain compatibility with Bashrat the Sneaky's DriverPacks and the 8.3 naming convention: 7za.exe renamed to 7z.exe, SetDevicePath.exe renamed to DevPath.exe, and WatchDriverSigningPolicy.exe renamed to WatchDSP.exe. The default location for 7z.exe, DevPath.exe, and WatchDSP.exe is now \OEM\bin (disc) or \$OEM$\$1\bin (RIS).
  • 070_VMwareTools.vbs v1.01 - Added support for VMware Server and GSX. The date in the BIOS string is queried to determine which version is present. The additional installer filenames that the script will look for are 071_VMwareTools-srv10.exe and 071_VMwareTools-gsx321.exe. Thanks and credit go to MSFN member maxximum for both the suggestion and the sample code.
  • 110_CopySource.vbs v1.02 - Added support for selectively running the script based on chassis type, similarly to the 060_VPN.vbs script. Added support for clients installed via RIS. Thanks to MSFN member cluberti for the suggestion.
  • 150_DefragHD.vbs v1.02 - Added cleanup for the 110_CopySource.vbs and 120_Compress.vbs scripts in the event that they do not meet the criteria for execution and they remain on the system drive.
  • 170_ConfigAccounts.vbs v1.04 - New boolean entry UseNameSettings allows for 171_NameSettings.hta to be disabled even if it is present.
  • 190_SetNextBoot.vbs v1.03 - Additon of a new field for command line arguments for the custom RunOnceEx settings. Custom RunOnceEx ID's now end with number 5. Built-in ScriptPack entries all end with number 0.
  • 300_Final.vbs v1.01 - Added the ability to initiate the reboot by using NTregOpt to defragment the registry.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Version 1.04

Postby RogueSpear » Tue Aug 08, 2006 12:07 pm

Version 1.04 - 08/08/2006
  • presetup.cmd V2.0 - More changes made for compatability with DriverPacks BASE V6.08.
  • 100_Cleanup.vbs V1.04, 190_SetNextBoot.vbs V1.04, 300_Final.vbs V1.03 - Code added that will delete custom files used in the custom RunOnceEx entries if they are found on the system drive.
  • 170_ConfigAccounts.vbs V1.05 - Processing for the built-in Administrator account has been moved to process after the NameSettings HTA Application. In the case of some laptops, after a 15 minute period of inactivity, the system would go to sleep making it impossible to log back in and continue. Implemented optional e-mail notification when user input is required.
  • 300_Final.vbs V1.03 - Implemented optional e-mail notification for when the computer installation is finished.
  • 999_Email.vbs - This is a new script which is used by 170_ConfigAccounts.vbs and 300_Final.vbs for sending out an email notification to update the user on installation progress.
  • DelAUSM.vbs - This is a new script which will delete all of the contents of the All Users Start Menu with the exception of the Startup folder and any shortcuts contained in the Startup folder. I had originally intended to implement this functionality into the 100_Cleanup.vbs script, but then realized that timing is everything. Some users may want to implement this script far later in the RunOnceEx series in order to clean up any shortcuts that may be created after the 100_Cleanup.vbs script runs.
  • CreateShortcuts.vbs and Student-Streets.vbs - have been renamed to not having a preceeding number assignment. These are exmaple scripts that the user can use or modify and run anywhere in the RunOnceEx sequence that they chose.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Mon Oct 30, 2006 11:10 pm

Version 1.05 - 10/30/2006
  • presetup.cmd V2.1 - Yet even more changes made for compatability with DriverPacks BASE V6.10.
  • cmdlines.vbs V1.07 - Dropped the number assignment of the KTD script from 090 to 080 in order to support the new DriverPack's Finisher. All support for legacy DriverPacks scripts has been removed. Added support for xehqter's OEMScan utility. The three archived registry files that can be downloaded during installation have been greatly updated and improved. These files are also now included in the ScriptPack distribution.
  • 080_KTD.vbs V1.03 - Dropped the number assignment from 090 to 080 in order to allow the DriverPacks Finisher to execute afterwards at 090. This is necessary because the DP Finisher deletes the \D directory as part it's cleanup routine. Consequently this script no longer uses a "move" command for D, but rather a copy command, which will result in a potentially much longer execution time and a much larger hard drive space requirement during script execution.
  • 100_Cleanup.vbs V1.05 - Several changes were made with regard to DiverPack compatibility and cleanup of RunOnceEx installers. The shortcut for "Microsoft Update" can now be optionally deleted.
  • 150_DefragHD.vbs V1.03 - Added support for Diskeeper and O&O Defrag. Changed the Default setting for PerfectDisk to use "DefragOnly" instead of "SmartPlacement" in order speed up the first pass defrag. PageDefrag still needs to be located within the system path in order to run, but now if it is not the script will no longer crash.
  • 250_FinalDefrag.vbs V1.03 - Added support for Diskeeper and O&O Defrag. PageDefrag still needs to be located within the system path in order to run, but now if it is not the script will no longer crash.
  • 500_Settings.ini V1.03 - The KTD directory list was overhauled to reflect changes in the DriverPacks and in particular to take into account the new directory structure assigned to the third party DriverPacks.
  • Misc. - The CreateShortcuts.vbs, DelAUSM.vbs, Student-Streets.vbs, and Template.vbs scripts are no longer included in the ScriptPack distribution. They now have their own threads and download links.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Mon Sep 10, 2007 5:10 pm

Version 1.06 - 09/10/2007
  • presetup.cmd V2.2 - Changes made for compatability with DriverPacks BASE V7.05.
  • cmdlines.vbs V1.08 - Changes made to support ScriptPack Addons.
  • 100_Cleanup.vbs V1.06 - Changes made to support ScriptPack Addons.
  • 160_ConfigPageFile.vbs V1.01 - If the SizeRelativetoRAM value would result in a pagefile larger then 4096MB (4GB), then the pagefile will be set to 4096MB since this is the largest allowable size (at least under x86). Previously such a circumstance would result in the script crashing.
  • 190_SetNextBoot.vbs V1.05 - The option to reboot without defragmenting the registry is now accomplished with shutdown.exe instead of using WMI to immediately reboot. This new method also inserts a two minute delay in order to allow the OS to register components properly. For the time being this is the recommended method for rebooting until I can put together and test an AutoIt script that will perform the delay prior to defragmenting the registry.
  • 300_Final.vbs V1.05 - The same changes as 190_SetNextBoot.vbs.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Sun Jan 27, 2008 6:03 pm

Version 1.0.7 - 01/27/2008
  • cmdlines.vbs V1.09 - Changes made to support ScriptPack Addons. Some forum reported bugs have been fixed.
  • 150_DefragHD.vbs V1.04 - Added support for using JkDefrag if it is located somewhere within the system path. Added support for overriding the command line switches with user defined switches by reading the new value "Switches" from the 500_Settings.ini file.
  • 250_FinalDefrag.vbs V1.04 - Same changes as in 150_DefragHD.vbs.
  • General - The above listed changes and some others from previously releases are now supported in AutoImage as of v0.1.9.8
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Wed Jun 11, 2008 8:58 am

Version 1.0.8 - 06/11/2008
  • All Scripts - Updated for XP SP3 compatibility - thanks to forum member dommac2000 for the solution and the code. Initial efforts toward Windows 2000 compatibility.

Please note that I have not done any testing in Windows 2000. There may be some incompatibilities with WMI as Windows 2000 has a lesser implementation of WMI. I have done a bit of testing in Windows XP SP3 and the fix provided by dommac2000 seems to work perfectly.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Thu Jul 10, 2008 5:51 pm

Version 1.1.0.0 - 07/10/2008
  • All Scripts - Changed to a four part version numbering scheme.
  • Malware prevention .7z files - Up to date as of today. They are both included with this download and are currently posted online (tested and working). The nearly two year long running issue of one of the files being named wrong has been fixed. :oops:
  • PRESETUP.CMD - My file has been completely replaced by the fantastic custom presetup.cmd made by DumpyDooby. This is a fantastic addition and the logging function is has already come in handy for me.
  • 150_DefragHD.vbs and 250_FinalDefrag.vbs - Updated for PerfectDisk 2008 compatibility.
  • 160_ConfigPageFile.vbs - Updated for finer control of page file configuration. Now a value between 1 and 32 will act as a multiplier as before, but anything above 32 will be treated as literal (ex: 2048 = 2GB). If either a multiplier or literal value exceeds 4096, the value will be dropped to 4092. For some reason, the valid value of 4096 was giving me fits (which it never did before), so 4092 was settled upon.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Sun Aug 31, 2008 12:45 pm

Version 1.1.1.0 - 08/31/2008
  • cmdlines.vbs - Updated for compatibility with Mozilla Firefox, Paint.NET, Microsoft Pro Photo Tools, and Microsoft Visual Studio Tools for the Office System v3.0 ScriptPack Addons.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Postby RogueSpear » Thu Sep 04, 2008 5:54 pm

Version 1.1.1.1 - 09/04/2008
  • cmdlines.vbs - Updated for compatibility with Windows Defender ScriptPack Addon.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Re:

Postby RogueSpear » Fri Sep 19, 2008 1:59 pm

Version 1.5.0.0 - 09/19/2008

This is a pretty big update as far the ScriptPack goes. I practically re-wrote the cmdlines.vbs and 100_Cleanup.vbs scripts - and they were the most complex scripts to begin with. The major thrust of this release is the implementation of logging. In doing so I've found lots of other bugs which should mostly be fixed. I'm killing myself for not having done this years ago.

The process by which registry files which are compressed to 7-Zip archives are downloaded should be far more reliable and robust now. If you include 7-Zip files in your source but also have new ones downloaded during setup, the downloaded files will be compared to the files already in the source. Whichever is more recent will be used.

The cmdlines.reg and 101_Registry.reg files may now be compressed to 7-Zip archives and placed in your source as such. It's a trivial amount of space savings I know, but the option is available for those want to take advantage of it.

Full logging has been implemented in the cmdlines.vbs, 100_Cleanup.vbs, 120_Compress.vbs, 150_DefragHD.vbs, and 250_FinalDefrag.vbs scripts. All other scripts have preliminary support only - only the start and finish of the scripts are logged. An optional global setting has been added to 500_Settings.ini for the level of logging. By default the value is set to False, and if the value is not found at all it will default to False. When set to True, the output of command line 7-Zip will be included in the logging.

For several reasons this round of updates was far more troublesome than usual. During cmdlines if there is a WSH error you get no notification of such errors. Obviously this makes debugging a little difficult. Anyway I'm taking a short break from the ScriptPack to catch up on the backlog of installers. Then there will be more to come.
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY

Updated to v1.5.1.0

Postby RogueSpear » Mon Oct 13, 2008 8:09 pm

20081013 - Updated to v1.5.1.0
User avatar
RogueSpear
Site Admin
 
Posts: 1889
Joined: Mon Jun 26, 2006 1:14 pm
Location: Buffalo, NY


Return to Scripts and Utilities

Who is online

Users browsing this forum: No registered users and 0 guests