I came across an instance where I needed to upgrade a Windows 7 image to Windows 8.1 and then capture that image for deployment with System Center Configuration Manager 2012 R2. I found out shortly after starting this task that when you upgrade an operating system you can no longer run SysPrep. So I started looking around and modifying registry keys and running commands.

Below is the method that I found to work perfectly.
Remove this KEY from the Registry:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\Upgrade
Remove this REG_DWORD from the Registry:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\Upgrade
Set this REG_DWORD from the Registry:
Computer\HKEY_LOCAL_MACHINE\SYSTEM\Setup\Status\SysprepStatus\CleanupState [Set Hexadecimal Value: 7]
Run this command as Administrator:
slmgr /dli
After your operating system is activated re-run SysPrep and it will work!
– Harry Caskey

Right on!!
Wow, works like a charm! Thanks!
You are an absolute star.
I work in a school and needed to sysprep a new laptop before i could image it. It was originally a home edition windows 8 and I upgraded (using our site licence) to 8.1 pro edition. Your regedit commands worked a treat and now i can carry on with the job in hand. Thank you for posting this answer. I’m sure others will find it just as informative as I have.
Thank you very much for finding a solution to something that should never have been a problem! None of the Microsoft related sites offered a working solution. I’m fortunate to have stumbled across yours.
Awesome! I’m glad I could help you out!
-Harry Caskey
FYI- I did find another possible cause of this error. If the drive is bitlocked this error will result. Decrypt the drive to proceed.
Ah! Thanks for the heads up, I have not entered the world of bitlocking yet. This is good to know!
-Harry Caskey
Works for me! In addition I had to re-arm Sysprep. Also, I did not need reset the CleanupState. Thanks!
Awesome! I’m glad you were able to get this to work! I reset the CleanupState as a precaution, but it may not be necessary. I’m glad it worked out for you!
-Harry Caskey
Worked perfectly, thanks.
Appears to also work on Windows 10.
Tried the same registry trick but not able to do sysprep, its giving the same error. Upgraded Windows 8.1 to Windows 10 Technical preview
What is the error message you get?
I’m trying to use this fix because I want to move the user folders from my SSD to my 1 TB hard drive. I get the error, but once I go into to the setupact.log, I can’t find any of those things in the registry. I need to get this figured out soon because my SSD only has 4 GB left. Please help
What is the error message you get?
There’s another way I could see to do that if it’s just the User folders. Boot some other OS that can read NTFS (like a live Ubuntu CD), and then copy the User folder to the other drive. Rename the old Users folder (just in case), and then create a Symlink or Junction Point to the Users folder on the other drive.
Though, personally, I wouldn’t move the entire Users folders. Those are used a lot, so you want them on the faster drive. What needs to be moved are all your Documents/Images/Videos, etc. You can do basically the same thing I described above, except you can actually do that from within Windows.
In fact, I’m not entirely sure why you would try moving the entire OS to the slower drive.
Thank you, thank you, thank you!!!
Your post has save me LOTS of time.
CEM
first…thanks!
I just did this on a Windows 7 Pro Upgrade to Windows 10 Pro.
success!
For anyone saying this doesn’t work, make sure you check the ** System32\Sysprep\Panther\setupact.log ** file and see what other errors you might be getting. Turns out I had to uninstall any apps I had installed from the Windows Store. It’s unfortunate, but Microsoft requires any Modern UI apps to be sideloaded instead of automatically updated.
Also works on Windows 10 RTM to Windows 10 Version 1511. This saved me from a lot of cursing Microsoft. After all, I didn’t want to rebuild my entire gold image from scratch every couple of months because of their new service model. Thanks!
Perfect!!
I had some message saying I had to uninstall a Microsoft_SurfaceHub thing. This helped remove it. Then it worked!
https://support.microsoft.com/en-us/kb/2769827
Excellent post!
Works like a charm after hours and hours of searching on the Internet.
Thank you!
Perfect!!! I love You!!!
I Strongly recommend this be done as Administrator. Remove all of the other accounts since apps are auto installed for them. This is the only way I got it to work.
Thanks, it worked perfectly for my upgraded 8 to 8.1 Windows
You are simply the best (na, na, na, naaa)