Using Custom POSReady Setup Scripts
2/16/2009
You can run custom Setup scripts before or after Windows Embedded POSReady 2009 is installed by using the PreSetup.cmd file and PostSetup.cmd file. Custom Setup scripts are useful if you want to automatically change your configuration of POSReady before or after installation. You can change the registry, modify your installation disk, test for network connectivity, and so on. The following table describes some of the executable commands that are typically used in these files.
Executable Command | Description |
---|---|
Diskpart |
A disk and partition utility |
Factory |
A Sysprep utility that can install custom drivers, applications, and more |
IPConfig |
A TCP/IP configuration utility |
Net use |
A network resource management utility |
Notepad |
A text editor |
Ping |
A utility that tests network connectivity |
Reg |
A text-based registry editor |
Regedit |
A tree-view registry editor |
Replace |
A text search and replacement utility |
Tracert |
A network utility that collects information about the devices between your computer and a destination |
Xcopy |
A utility that copies and modifies files |
SetupLauncher.exe and Setup Scripts
When POSReady Setup starts, SetupLauncher.exe looks for the PreSetup.cmd file in the Setup directory of the installation media. If the file exists, it will be processed before an interactive or unattended installation starts. After POSReady has installed, SetupLauncher looks for a PostSetup.cmd file. If the file exists, it will be processed before the computer restarts and First Boot Agent (FBA) starts.
Note
You cannot run SetupLauncher.exe from a network drive.
Sample PreSetup.cmd File
The following is a sample PreSetup.cmd file:
factory –winpe >> X:\output.log
net use * \\mysharedlocation /user:username password >> X:\output.log
This file uses the factory command and the -winpe switch to configure the network controller and hard disk with default device drivers. The log information for this action is stored on an external drive with the path of X:\output.log
. The computer then connects to \\mysharedlocation
by using the specified username and password that is required for that network share. Again, the log information for this action is stored at X:\output.log
.
Sample PostSetup.cmd File
The following is a sample PostSetup.cmd file:
copy X:\output.log C:\output.log
This file uses the copy command to duplicate the log file from drive X
to drive C
.