.NET Framework provides the method System.Environment.GetFolderPath to obtain the location of some special folders. This method uses the enumeration System.Environment.SpecialFolder that doesn’t include a member for the All Users Desktop Folder. To find the location of the All Users Desktop folder we need to use the Windows Script Host in the following way:

using IWshRuntimeLibrary;

object allUsersDesktop = “AllUsersDesktop”;
WshShell shell = new WshShellClass( );
string shortcutPath = shell.SpecialFolders.Item( ref allUsersDesktop ).ToString( );

To use Windows Scripting Host from Visual Studio .NET right-click on the project name within the Solution Explorer, select ‘Add Reference’, select the ‘COM’ tab, find and select the ‘Windows Script Host Object Model’ in the listbox, click ‘Select’, and then click ‘OK’.

Here you can download the material (in spanish) of the talk “Programming in Windows Vista” (“Programando en Windows Vista”) that I did in Microsoft Argentina HQ together with Diego Gonzalez. The examples were developed with Vista 5381 and WinFX Febrary CTP.

Here you can download the material (in spanish) of the presentations that I did (together with Diego Gonzalez) in the event “Web Service Day”. Thank to Sergio Borromei from Microsoft Consulting Services for his huge collaboration with the Key Note presentation.