I have tried for a while following various online guides to do this but none are comprehensive enough. This guide will show you how to do what it says in the title. Every step I take is documented here and anyone reading will be able to follow it and have a finished WORKING deployment.
1. Copy the files from visual studio DVD to your computer. This part is quite important, copy the files to” C:\WINDOWS\VS2010Cache\vs2010\” This should leave you with the following folder structure at the above path.

Folder Structure
2. Launch an elevated command prompt and type in the below command:
Cd C:\WINDOWS\VS2010Cache\vs2010\setup
3. Then type in the following command:
Setup.exe /createunattend C:\WINDOWS\VS2010Cache\vs2010\setup\unattend64.ini
NB: This example is being performed on a 64 bit system, if you are creating an unattended deployment for a 32-bit system you will need to perform these steps on a 32-bit system. I have named my file “unattend64.ini” to make it clear it is for 64-bit deployments.
4. You will see the below screen, let this screen finish and click “Next”.

Visual Studio 2010 Create Unattend ini file fig 1
5. You will see the below screen, some of the items in the list on the left may be different depending on your existing setup. I always create this deployment on a VM that is vanilla so to make sure everything that is needed is part of the deployment. Tick the box to accept the licence and hit “Next”.

Visual Studio 2010 fig 3
6. You will see the below screen, here you should just normally click “Next” but again if your deployment situation demands a custom setup then adjust as you require. When finished click “Save Settings”.

Visual Studio 2010 fig 4
7. Once done you should see the below completion notice and find the ini file created at C:\WINDOWS\VS2010Cache\vs2010\setup\. The reason it is important regarding paths and locations is because the ini file contains paths back to the location of msi files at C:\WINDOWS\VS2010Cache\vs2010\. When running from SCCM this location doesn’t exist so the deployment normally fails. I have found a solution to get around this.

Visual Studio 2010 fig 5
8. Open up notepad and type the following batch code into the file.
C:\WINDOWS\VS2010Cache\vs2010\setup\setup.exe /q /norestart /unattendfile C:\WINDOWS\VS2010Cache\vs2010\setup\unattend64.ini
Save this file as something like setup.cmd, save it at C:\WINDOWS\VS2010Cache\vs2010\
9. This is where it gets a bit bespoke/different. Using WinRAR or 7zip or some other program that is similar we are going to create a self-extracting archive (SFX). These archives normally use the .exe file extension. For this example I am going to use WinRAR. You can download it for free on a 40 day trial licence but best to check this out yourself via google etc. In this example I have used the latest 64-bit version downloaded from the winrar website. Where I work we have a few licenced copies of an older version.
10. Navigate to C:\WINDOWS\VS2010Cache\vs2010\ and select all the files (ctrl+a). Right click and select “Add to Archive”. See the below screenshot.

Visual Studio 2010 fig 6
11. Tick the box “Create SFX Archive” and out of habit I always tick the box “Put Recovery Record” and change the compression method to “Best”. See the below screenshot.

Visual Studio 2010 fig 7
12. Click the advanced tab and then click “SFX Options” , this will bring up a screen like the one below. Review the below screenshots and enter the information as shown.

Visual Studio 2010 fig 8

Visual Studio 2010 fig 9

Visual Studio 2010 fig 10

Visual Studio 2010 fig 11

Visual Studio 2010 fig 12
13. Once you are finished in winrar you should have an exe file called vs2010.exe located at C:\WINDOWS\VS2010Cache\vs2010\. This exe file is what you will deploy with SCCM either in a task sequence or using software distribution. The reason why we used this method was to keep the paths consistent with our unattend64.ini file. You will notice that parts of the ini file reference absolute paths specific to where the VS2010 source files were located when the ini file was created. Using this method of deployment we maintain these paths avoiding any errors.
14. One option might be to try and edit the ini file to contain the paths to the distribution point on SCCM. This probably breaks all the rules of best practice and might result in poorly maintained packages. Far easier to bundle it up and store the setup files locally. If you wanted you could write into the setup.cmd file that launches from the SFX to delete the setup files. Obviously you won’t be able to delete setup.cmd as it will be running.
I have created a video of me doing this on a VM just so you can be 100% sure of how I did it. I will also try to get a video of it deploying with SCCM up on here as well.
Cheers!
PS – Here’s the video and as always it is best viewed in full screen mode.