While the typical development scenario for Windows Embedded Standard 7 is to first create an Answer File in Image Configuration Editor (ICE) and then deploy that to a device, it is also possible to do the reverse and generate an Answer File from an existing device.
There are several cases where this is useful:
Fortunately, the tools included in Standard 7 allow you to accomplish this in 3 easy steps:
Now let’s look at each step in detail.
Step 1: Export a list of installed packages using PkgScn
This step can be performed either online or offline. For online, first use the script CopyPkgScn.cmd to copy PkgScn.exe and related binaries to the device. CopyPkgScn.cmd will be located in the folder C:\Program Files\Windows Embedded Standard 7\Tools\Image Configuration Editor. If your device is running a 64-bit OS, use the version of the script in the X64Apps folder to copy 64-bit binaries.
Once PkgScn is copied to the device, run the following command line to get the packages:
PkgScn /Get-Packages /ConfigsetDir:
Otherwise for offine we need one more parameter to specify the location of the mounted image. Images (WIM files) can be mounted using ImageX or Dism:
PkgScn /Image:<mounted_image> /Get-Packages /ConfigsetDir:
After this command completes, the package information will be placed in a file in the current directory named AutoUnattend.xml. Keep this file handy as we will need it in Step 3.
Step 2: Generate the hardware and driver configuration using Tap
Next we will run Tap.exe on the device to get hardware and driver information. You can find tap in the directory C:\Program Files\Windows Embedded Standard 7\Tools\Image Configuration Editor, or the X64Apps directory for the 64-bit version. Tap.exe can only be done on the device itself. Once Tap.exe is on the device run the following command line:
This will save the hardware and driver information to a file named devices.pmq in the local directory.
Step 3: Import files into ICE
Launch ICE and select File -> Open Answer File
Select the AutoUnattend.xml file you generated from Step 1.
You should now be able to see an Answer File populated with the packages from your device (the exact packages will depend on what has been installed):
Next we’ll add the hardware and driver information from Step 2. From the menu select File- > Import-> Import PMQ and select the devices.pmq file.
Now you should be able to see the drivers show up in the Answer File pane:
[Optional] Additional Setup Information from IBW Installations
If you set up the original device using IBW (Image Based Wizard), you can also recover any configuration or settings made at that time. This data will be on the device in the file C:\Windows\panther\cbs_unattend.xml. To use this data in ICE, copy this file from the device then go to File -> Import -> Template and select the file. It will now be in the Distribution Share pane inside the Templates folder, so simply drag it over to your Answer File.
One note of caution if you do use the cbs_unattend.xml file – any sensitive user data such as usernames and passwords will have been obfuscated after install, so you will need to re-enter these settings in ICE.
At this point, you can create a configuration set to deploy this Answer File to another device, or continue modifying the Answer File to meet your needs.
Before wrapping up though, there are a few caveats which I should mention.
I hope you’ve found this article useful, if you have any questions or comments you can post them here or in the Windows Embedded Standard forums.
I am getting this error when I run this cmd "PkgScn /Get-Packages /ConfigsetDir:"
PkgScn: Unable to copy string ' '.
PkgScn: PkgScn failed with error 0x800707b.
also,"C:\Windows\panther\cbs_unattend.xml" does not exist but "C:\Windows\panther\cbs_unattend.txt" exists, could it be a typo on your end?
Does it change anything?
Found the answer for First post "PkgScn /Get-Packages /ConfigsetDir:" must dictate the path "PkgScn /Get-Packages /ConfigsetDir: C:\"
The file that should be placed in the Panther directory depends on what tool is used to create the image.
unattend.xml is the file generated if ICE is used to create the image.
cbs_unattend.xml is the file created when IBW is used to set up an image.
Hope this helps.