ok i had same thing hang. upgraded itunes to itunes 10. then upgraded my iphone 3gs to ios 5 went through the factory reset bolox along the way. then when it installed ios 5 on the iphone it told me my backup was either invalid or corrupt. i had to settle for having ios 5 but a completely wiped phone - pics, contacts, apps the works. ok I can take the hit for ios 5, tried to sync the phone with my laptop (windows vista) previously updated to itunes 10 and EVERY time it hung on the backup of my phone. ive read endless accounts of the same thing happening to people on every apple device. i couldnt do anything. i tried the "command prompt, netsh winsock reset" blah described at the begining of this post. IT DID NOTHING! so i picked away at everything, this is what worked for me..
Start itunes with no devices attached.
When its loaded go to Edit - Preferences - Then click Devices.
Tick the box - Prevent ipods, ipads and iphones syncing automatically, then click ok.
leave itunes running then disable ALL security software, malware protection etc AND internet connections. ( i am running microsoft security essentials -off. iobit malware fighter - off. iobit advanced system care - off. THEN intenet connection - off.
I then plugged in my 3gs via USB, nothing happens because id disabled it earlier!
on the left in devices it shows my iphone.
click it.
you should see the summary screen.
on that screen where it says 'Backup' choose 'back up to icloud' button.
scroll a little lower to 'options' and tick 'sync this iphone over Wi-Fi'
then click the Sync/Apply button.
leave it and it SHOULD do a sync and a backup (u should see it say last backup to icloud n the time your doing it as its going) once youve completed this eject the device, re-start security software, malware protection etc etc then re-connect to the internet.
give it a minute to all settle.
then re-connect your device.
you should have full functuallity, of itunes with no hangs. just seems like a conflict of security software to get the first back up. once youve got one theres no more chew!
well thats what worked for me, hope it helps someone because i spent days looking for help and got none! this is my first ever post so if it does help u at all plz click me a like!