O'Reilly logo

Microsoft® Visual Basic® .NET Programmer's Cookbook by Matthew MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Access the Desktop and the Start Menu

Problem

You want to access shortcuts or other files on the desktop or the Start menu.

Solution

You can access the underlying Start menu and desktop directories directly by retrieving the corresponding environment variables.

Discussion

.NET does not provide any classes for interacting with the desktop or Start menu. However, you can find the corresponding directories using Windows environment variables.

For example, you can retrieve the current user’s profile directory from the environment variable USERPROFILE. This directory contains two important subdirectories: \Desktop (which holds the files that are displayed on the current user’s desktop) and \Start Menu (which holds the user-specific shortcuts on the Start ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required