Link to home
Create AccountLog in
Windows 7

Windows 7

--

Questions

--

Followers

Top Experts

Avatar of ITS_Admin
ITS_Admin🇺🇸

Modifying the unattend.xml file to add CopyProfile
We have set up a profile in windows with the home page, start menu items,  and so forth that we want copied to any new use that signs on to the pc. We are trying to follow the microsoft article " Article ID: 973289" which tells you to
"Set CopyProfile to true in the Unattend.xml file that you will use with Sysprep in the next step"

Can anyone give us all the steps on how to do that (add the copy profile to the unattend.xml file) using the AIK tool.

Thanks

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of arixsinarixsin🇺🇸

I know M$ wants you to use their unattend.xml method for this, but check out this article for a way that I have always done it.

http://www.irongeek.com/i.php?page=security/windows-7-copy-default-profile

ASKER CERTIFIED SOLUTION
Avatar of ITS_AdminITS_Admin🇺🇸

ASKER

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Avatar of KTN-ITKTN-IT🇺🇸

ITS_Admin,

Thank you for these instructions.  I looked at http://support.microsoft.com/kb/973289 but could not make enough sense out of it to generate the proper unattend.xml file.  I couldn't have done it without your guidance.

To save others the trouble of messing with AIK, I have created a batch file that will automatically generate the unattend.xml file necessary to copy the currently logged in profile settings over to the Windows 7 default profile.  Then you will need to restart the computer, and after that the default profile should be set.

Save the following as a .BAT file.  *RUN AT YOUR OWN RISK*  You should know what you're doing.
You may need to unwrap long lines (especially the one in the middle of the series of ECHOs).

====BEGIN CODE=====

@ECHO OFF

ECHO Copy settings from currently logged in profile to the Default User Profile?
ECHO Please note the all files on the desktop will also be copied to the default profile.
set Choice=n
set /p Choice=Proceed? (y/n)[n]:
IF %Choice%==y GOTO YES
IF %Choice%==Y GOTO YES

:NO
ECHO Aborted.
PAUSE
EXIT

:YES
SET SPPath=%systemdrive%\Windows\System32\sysprep
ECHO ^<?xml version="1.0" encoding="utf-8"?^> >%SPPath%\unattend.xml
ECHO ^<unattend xmlns="urn:schemas-microsoft-com:unattend"^> >>%SPPath%\unattend.xml
ECHO     ^<settings pass="specialize"^> >>%SPPath%\unattend.xml
ECHO         ^<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"^> >>%SPPath%\unattend.xml
ECHO             ^<CopyProfile^>true^</CopyProfile^> >>%SPPath%\unattend.xml
ECHO         ^</component^> >>%SPPath%\unattend.xml
ECHO     ^</settings^> >>%SPPath%\unattend.xml
ECHO ^</unattend^> >>%SPPath%\unattend.xml

REM http://support.microsoft.com/kb/973289
REM type sysprep /? to get a list of possible switches.
REM Instead of /audit you may want /oobe.  Or just leave them out and use the GUI that comes up.
%SPPath%\sysprep.exe /generalize /audit /quit /unattend:%SPPath%\unattend.xml

IF %ERRORLEVEL%==0 ECHO Current profile copied to default profile
PAUSE
DEL %SPPath%\unattend.xml

=====END CODE=====

Would the batch file work for 64-bit architecture assuming I change this line:
ECHO         ^<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x86"
to
ECHO         ^<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="x64"

I can't think of a reason it wouldn't, and I may test regardless, but I thought I would ask first.

Thanks!

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of KTN-ITKTN-IT🇺🇸

Good question.  I haven't run AIK against a 64-bit .wim image, so I don't know what the resulting unattend.xml would look like.  I don't know if the PublicKeyToken parameter would change, too. If anyone tries it, please let us know.

Avatar of KTN-ITKTN-IT🇺🇸

I've been reading through this thread:
http://social.technet.microsoft.com/Forums/en/w7itprogeneral/thread/0be9b1f0-a21f-4889-9568-6ec455689aa9

and decided to check in the %ProgramFiles%\Windows AIK\Samples folder on my 64-bit machine.  This is the line that was in the headlessunattend_X64.xml file:

<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">

It looks like the publicKeyToken is the same, although I don't know why the processorArchitecture says "amd64."  What if someone doesn't have an amd processor?
       


Avatar of hsbgithsbgit🇺🇸

I created the unattend.xml file on a  Windows 7 64bit machine from 64bit media and it says amd64. I think it is a default setting for 64bit machines.

I run into a problem after I run the sysprep command. When windows reboots after configuring the sysprep I get an error stating that "Wndows could not parse or process unattended answer file for pass specialize...". I am using the <CopyProfile>true</CopyProfile> setting in the answer file. I can't seem to get sysprep to run correctly with the unattend.xml answerfile. If someone has any insight that would be great.
<?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">
            <CopyProfile>true</CopyProfile>
            <ProductKey>xxxxxxxxxxxxxxxxxxxxxxxxx</ProductKey>
        </component>
    </settings>
    <settings pass="generalize">
        <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">
            <DoNotCleanTaskBar>true</DoNotCleanTaskBar>
        </component>
    </settings>
    <cpi:offlineImage cpi:source="wim:c:/users/test/desktop/new%20folder/install.wim#Windows 7 ENTERPRISE" xmlns:cpi="urn:schemas-microsoft-com:cpi" />
</unattend>

Open in new window


Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of KTN-ITKTN-IT🇺🇸

Try taking the <ProductKey> out of the specialize path.  Just a guess...

Intel licensed some 64 bit code from AMD to make their processors.  That is why here and there around the place you will find references to amd64 which is compatible with both AMD and Intel.

Thank you KTN-IT for the WONDERFUL instructions and example.  It was exactly what I was looking for.

For those that received this error:
Failure occurred while executing 'drmv2clt.dll
I had to turn off Windows Media Player Network Sharing Service.  Seems to be a known bug:
http://social.technet.microsoft.com/Forums/en/w7itproinstall/thread/c469805c-98af-4bb2-9655-c86c294470a9

Once I applied all this I was was then abile to copy the default profile for my VDI environment.  If someone gave MS the direction to take something simple and complicate it I would say they get a 10 on this one.  I'm all for more security, if that was the intention here,  but add the facilities to keep administration costs down.

Thanks for all the help here, it made the choice for the subscription well worth it. unattend.xml

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.

Windows 7

Windows 7

--

Questions

--

Followers

Top Experts

Windows 7 is an operating system from Microsoft. Features include multi-touch support, a redesigned Windows Shell with a new taskbar, referred to as the Superbar, a home networking system called HomeGroup, and performance improvements.