Is there builtin to get C:\Document&Settings\Username\startmenu..P

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Does VS2005 have anything buildin to retrieve the Directory path for

C:\Documents and Settings\UserName\Start Menu\Programs...

Like an application has Application.StartupPath

Or do I have to hardcode:

Dim strUserID As String = System.Environment.UserName
Dim path As String = "C:\Documents and Settings\strUserID\Start Menu...
 
Rich said:
Does VS2005 have anything buildin to retrieve the Directory path for
C:\Documents and Settings\UserName\Start Menu\Programs...

It's in the Environment Namespace:

DirectoryInfo di =
new
DirectoryInfo(Environment.GetFolderPath(Environment.SpecialFolder.Favorites));

MessageBox.Show(di.FullName);
 
Hello,

Does VS2005 have anything buildin to retrieve the Directory path for

C:\Documents and Settings\UserName\Start Menu\Programs...

Like an application has Application.StartupPath

Or do I have to hardcode:

Dim strUserID As String = System.Environment.UserName
Dim path As String = "C:\Documents and Settings\strUserID\Start Menu...

If it for the current user, the follwing expression will get you their
start menu

Environment.GetFolderPath(Environment.SpecialFolder.StartMenu)

For a named user think you might be forced to build it yourself, but by
first getting the system drive. After that you need a bunch of switch
statement because different Windows Versions store these folders in
different locations e.g. Windows NT and 2000 I think stores user folders in
the winnt folder
 
Back
Top