0

I've got 2 Windows installations which are identical, the same settings, the same programs. The only difference is that the Windows architecture is different, the one is 32bit and the other one is 64bit.

When having sysprepped my 32bit installation with the following answer file:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FolderLocations>
                <ProfilesDirectory>U:\Users</ProfilesDirectory>
            </FolderLocations>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -ExecutionPolicy Bypass -File C:\Windows\System32\Scripts\PinTaskbarItems\Managetaskbar\Taskband.ps1</CommandLine>
                    <Description>Sets the pinned taskbar items and restarts the explorer process</Description>
                    <Order>1</Order>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
            </FirstLogonCommands>
        </component>
    </settings>
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DesktopOptimization>
                <ShowWindowsStoreAppsOnTaskbar>false</ShowWindowsStoreAppsOnTaskbar>
            </DesktopOptimization>
            <CopyProfile>true</CopyProfile>
            <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
            <EnableStartMenu>true</EnableStartMenu>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:c:/users/bas/desktop/iso&apos;s/x32/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

It's currently only about the FirstLogonCommands part, which totally works fine after 32bit sysprep. The command runs without any errors and gives back the desired result.

When having adjusted the answer file for my 64bit installation, it looks like this:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
    <settings pass="specialize">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <DesktopOptimization>
                <ShowWindowsStoreAppsOnTaskbar>false</ShowWindowsStoreAppsOnTaskbar>
            </DesktopOptimization>
            <CopyProfile>true</CopyProfile>
            <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
            <EnableStartMenu>true</EnableStartMenu>
        </component>
    </settings>
    <settings pass="oobeSystem">
        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <FolderLocations>
                <ProfilesDirectory>U:\Users</ProfilesDirectory>
            </FolderLocations>
            <FirstLogonCommands>
                <SynchronousCommand wcm:action="add">
                    <CommandLine>%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -ExecutionPolicy Bypass -File C:\Windows\System32\Scripts\PinTaskbarItems\Managetaskbar\Taskband.ps1</CommandLine>
                    <Description>Sets the pinned taskbar items and restarts the explorer process</Description>
                    <Order>1</Order>
                    <RequiresUserInput>false</RequiresUserInput>
                </SynchronousCommand>
            </FirstLogonCommands>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:e:/sources/install.wim#Windows 10 Pro" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

The only thing that's reversed is the pass parameter of the settings key. When I tried this answer file on the 64bit installation sysprep, the FirstLogonCommands did not run. The rest of the answer file worked perfectly, just as the 32bit version.

Both of the answer files are validated by WSIM.

I tried copying the line from the <CommandLine> key into a CMD (with or without administrator priveleges) and running this. When this run, the command just run without any errors.

The problem is that the script is not running on my 64bit installation sysprep.

How does this come and how can I make this script run by using this answer file?

  • @LPChip This just totally confused me. It is indeed a folder where I can find a powershell etc. But how can the command work in a regular cmd then? – Bas Aug 25 '16 at 22:15
  • Nevermind about what I wrote earlier. Syswow64 is the x86 version of the system32 folder. – LPChip Aug 25 '16 at 22:17
  • I do see something that could cause this, and thats the ProfilesDirectory. Its different – LPChip Aug 25 '16 at 22:17
  • That's my bad! The ProfilesDirectory is set to U:\Users which works fine on the 32bit version aswell. – Bas Aug 25 '16 at 22:18
  • @LPChip Yes, I changed it now. But how can something like this happen, if the command just works in a regular cmd? – Bas Aug 25 '16 at 22:19

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.