HS Banner
Back
Environment GetFolderPath Method

Author: Admin 10/21/2022
Language: Visual Basic .NET
Tags: environment getfolderpath


Description:

GetFolderPath (Environment+SpecialFolder) gets the path to the specified system special folder.

Article:

Here's a set of functions to get the path the specified system special folder.

        Public Function GetSpecialFolderSystem32() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.System)
        End Function

        Public Function GetSpecialFolderWindows() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Windows)
        End Function

        Public Function GetSpecialFolderUserProfile() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
        End Function

        Public Function GetSpecialFolderTemplates() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Templates)
        End Function

        Public Function GetSpecialFolderSystemX86() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.SystemX86)
        End Function

        Public Function GetSpecialFolderStartup() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Startup)
        End Function

        Public Function GetSpecialFolderStartMenu() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.StartMenu)
        End Function

        Public Function GetSpecialFolderSendTo() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.SendTo)
        End Function

        Public Function GetSpecialFolderResources() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Resources)
        End Function

        Public Function GetSpecialFolderRecent() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Recent)
        End Function

        Public Function GetSpecialFolderPrograms() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Programs)
        End Function

        Public Function GetSpecialFolderProgramFilesX86() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)
        End Function

        Public Function GetSpecialFolderProgramFiles() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
        End Function

        Public Function GetSpecialFolderPrinterShortcuts() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.PrinterShortcuts)
        End Function

        Public Function GetSpecialFolderPersonal() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Personal)
        End Function

        Public Function GetSpecialFolderNetworkShortcuts() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.NetworkShortcuts)
        End Function

        Public Function GetSpecialFolderMyVideos() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.MyVideos)
        End Function

        Public Function GetSpecialFolderMyPictures() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)
        End Function

        Public Function GetSpecialFolderMyMusic() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.MyMusic)
        End Function

        Public Function GetSpecialFolderMyComputer() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.MyComputer)
        End Function

        Public Function GetSpecialFolderLocalizedResources() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.LocalizedResources)
        End Function

        Public Function GetSpecialFolderLocalApplicationData() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
        End Function

        Public Function GetSpecialFolderInternetCache() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.InternetCache)
        End Function

        Public Function GetSpecialFolderHistory() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.History)
        End Function

        Public Function GetSpecialFolderFonts() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Fonts)
        End Function

        Public Function GetSpecialFolderFavorites() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Favorites)
        End Function

        Public Function GetSpecialFolderDesktopDirectory() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory)
        End Function

        Public Function GetSpecialFolderDesktop() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
        End Function

        Public Function GetSpecialFolderCookies() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.Cookies)
        End Function

        Public Function GetSpecialFolderCommonVideos() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonVideos)
        End Function

        Public Function GetSpecialFolderCommonTemplates() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonTemplates)
        End Function

        Public Function GetSpecialFolderCommonStartup() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonStartup)
        End Function

        Public Function GetSpecialFolderCommonStartMenu() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonStartMenu)
        End Function

        Public Function GetSpecialFolderCommonPrograms() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonPrograms)
        End Function

        Public Function GetSpecialFolderCommonProgramFilesX86() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFilesX86)
        End Function

        Public Function GetSpecialFolderCommonProgramFiles() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonProgramFiles)
        End Function

        Public Function GetSpecialFolderCommonPictures() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonPictures)
        End Function

        Public Function GetSpecialFolderCommonOemLinks() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonOemLinks)
        End Function

        Public Function GetSpecialFolderCommonMusic() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonMusic)
        End Function

        Public Function GetSpecialFolderCommonDocuments() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)
        End Function

        Public Function GetSpecialFolderCommonDesktopDirectory() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonDesktopDirectory)
        End Function

        Public Function GetSpecialFolderCommonAdminTools() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CommonAdminTools)
        End Function

        Public Function GetSpecialFolderCDBurning() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.CDBurning)
        End Function

        Public Function GetSpecialFolderApplicationData() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
        End Function

        Public Function GetSpecialFolderAdminTools() As String
            Return Environment.GetFolderPath(Environment.SpecialFolder.AdminTools)
        End Function

Environment.GetFolderPath Method (System) | Microsoft Learn


Back
Comments
Add Comment
There are no comments yet.