Those of you familiar with the WEPOS attended installation process may have seen the “Press any key for a command prompt” screen that appears during the setup initialization. Pressing any key on the keyboard while this message is visible will interrupt setup and give you a command window. From this command window you can perform a number of tasks before you continue with setup. Once setup completes, the focus returns to the command window and you can perform additional tasks before exiting and rebooting the computer.

To take this a step further, you can take advantage of this functionality during an unattended installation by placing the files presetup.cmd and postsetup.cmd into the Setup folder. Let’s use the example where you want your WEPOS system to have two partitions. You could create both partitions prior to your unattended answer file being processed, and format the second partition after the setup completes.

To create both partitions before your unattended answer file is processed; in presetup.cmd you would call DISKPART.EXE to execute a DISKPART script located in the same directory as presetup.cmd. The script would instruct DISKPART.EXE how to create the partitions. Once the script is complete, setup will begin processing your unattended answer file. If you want to install WEPOS onto a partition that you created in presetup.cmd, make sure you use the <ModifyPartition> element within <DiskConfig> in your unattended answer file rather than <CreatePartition>.

The postsetup.cmd file would contain instructions to format the second partition. Call FORMAT.EXE to format this partition. Since FORMAT.EXE prompts the user for a confirmation before proceeding, you can embed the confirmation into the postsetup.cmd script by adding “ECHO Y |”, resulting in a command like “ECHO Y | format.exe /FS:NTFS /V:HDD2”.

After setup is finished and WEPOS has completed the FBA process, you will find a second partition formatted and ready for use.

For information about writing a DISKPART script, please refer to TechNet DISKPART Documentation.

For a complete list of console applications that can be used in presetup.cmd or postsetup.com, look for other .EXE files in the i386/System32 directory on the WEPOS CD.

For additional information of using custom presetup.cmd and postsetup.cmd scripts, please reference the MSDN WEPOS Using Custom Scripts Documentation.

- Terry