Feedback

Nützliches aus der Registry

Sprache: VB

manchmal braucht man ein paar Werte aus der Registry die einzelne oder alle User betreffen. Hier ein kleiner Auszug. Die funktione liefern die Rückgabewerte aus – hoffentliche selbsterklärenden – Werten. P.S. Ich habe die Funktionen noch nicht unter Vista ausprobiert!
'Cu steht für CurrentUser

Public reg As Microsoft.Win32.Registry

Public Function CookiesPath() As String

        Return reg.Users.OpenSubKey(".DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Cookies")

End Function

Public Function CuCookiesPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Cookies")

End Function

Public Function CuRecentPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Recent")

End Function

Public Function CuDesktopPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Desktop")

End Function

Public Function CuFavoritesPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Favorites")

End Function

Public Function CuSendToPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("SendTo")

End Function

Public Function CuStartMenuPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Start Menu")

End Function

Public Function CuHistoryPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("History")

End Function

Public Function CuNetHoodPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("NetHood")

End Function

Public Function CuStartupPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Startup")

End Function

Public Function StartupPath() As String

        Return reg.Users.OpenSubKey(".DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Startup")

End Function

Public Function CommonStartupPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Startup")

End Function

Public Function CommonTemplatesPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Templates")

End Function

Public Function CommonDocumentsPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Documents")

End Function

Public Function CommonAdministrativeToolsPath() As String

     Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Administrative Tools")

End Function

Public Function CommonAppDataPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common AppData")

End Function

Public Function PersonalPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Personal")

End Function

Public Function MediaPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersion").GetValue("MediaPath")

End Function

Public Function SystemRoot() As String

        Return reg.LocalMachine.OpenSubKey("SOFTWAREMicrosoftWindows NTCurrentVersion").GetValue("SystemRoot")

End Function

Public Function GetCommonFilesPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersion").GetValue("CommonFilesDir")

End Function

Public Function CachePath() As String

        Return reg.Users.OpenSubKey(".DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Cache")

End Function
'Cu steht für CurrentUser

Public reg As Microsoft.Win32.Registry

Public Function CookiesPath() As String

        Return reg.Users.OpenSubKey(".DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Cookies")

End Function

Public Function CuCookiesPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Cookies")

End Function

Public Function CuRecentPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Recent")

End Function

Public Function CuDesktopPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Desktop")

End Function

Public Function CuFavoritesPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Favorites")

End Function

Public Function CuSendToPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("SendTo")

End Function

Public Function CuStartMenuPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Start Menu")

End Function

Public Function CuHistoryPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("History")

End Function

Public Function CuNetHoodPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("NetHood")

End Function

Public Function CuStartupPath() As String

        Return reg.CurrentUser.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Startup")

End Function

Public Function StartupPath() As String

        Return reg.Users.OpenSubKey(".DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Startup")

End Function

Public Function CommonStartupPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Startup")

End Function

Public Function CommonTemplatesPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Templates")

End Function

Public Function CommonDocumentsPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Documents")

End Function

Public Function CommonAdministrativeToolsPath() As String

     Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common Administrative Tools")

End Function

Public Function CommonAppDataPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Common AppData")

End Function

Public Function PersonalPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Personal")

End Function

Public Function MediaPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersion").GetValue("MediaPath")

End Function

Public Function SystemRoot() As String

        Return reg.LocalMachine.OpenSubKey("SOFTWAREMicrosoftWindows NTCurrentVersion").GetValue("SystemRoot")

End Function

Public Function GetCommonFilesPath() As String

        Return reg.LocalMachine.OpenSubKey("SoftwareMicrosoftWindowsCurrentVersion").GetValue("CommonFilesDir")

End Function

Public Function CachePath() As String

        Return reg.Users.OpenSubKey(".DEFAULTSoftwareMicrosoftWindowsCurrentVersionExplorerShell Folders").GetValue("Cache")

End Function