Some time ago I wrote an article about how to do an unattended install of the .NET Framework 2.0. A visitor asked the following question about doing this in a login script:
Here’s a way of doing it. Note that this sample assumes you’re writing a standard/legacy .BAT/.CMD login script.
If you’re using .VBS or .KIX login scripts you’d obviously want to use your chosen script’s method of checking that file location. A couple of things to note:
- 2.0.50727 is the latest version of .NET 2.0 as of the date of this post.
- .NET 3.5 SP1 rolls up .NET 2.0 and all its features so you could just install that instead (it doesn’t include support for .NET 1.1 though).
- You could also check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework or HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Policy … there are keys that that relate to the installed state of the various .NET framework versions.
In the :NotInstalled section of the script sample above you’d run the unattended installation of the framework.