Feedback

VB - Nützliches aus der Registry

Veröffentlicht von am 1/14/2007
(7 Bewertungen)
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(".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Cookies")

End Function

Public Function CuCookiesPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Cookies")

End Function

Public Function CuRecentPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Recent")

End Function

Public Function CuDesktopPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Desktop")

End Function

Public Function CuFavoritesPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Favorites")

End Function

Public Function CuSendToPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("SendTo")

End Function

Public Function CuStartMenuPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Start Menu")

End Function

Public Function CuHistoryPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("History")

End Function

Public Function CuNetHoodPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("NetHood")

End Function

Public Function CuStartupPath() As String

        Return reg.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Startup")

End Function

Public Function StartupPath() As String

        Return reg.Users.OpenSubKey(".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Startup")

End Function

Public Function CommonStartupPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Startup")

End Function

Public Function CommonTemplatesPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Templates")

End Function

Public Function CommonDocumentsPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Documents")

End Function

Public Function CommonAdministrativeToolsPath() As String

     Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common Administrative Tools")

End Function

Public Function CommonAppDataPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Common AppData")

End Function

Public Function PersonalPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Personal")

End Function

Public Function MediaPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion").GetValue("MediaPath")

End Function

Public Function SystemRoot() As String

        Return reg.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows NT\CurrentVersion").GetValue("SystemRoot")

End Function

Public Function GetCommonFilesPath() As String

        Return reg.LocalMachine.OpenSubKey("Software\Microsoft\Windows\CurrentVersion").GetValue("CommonFilesDir")

End Function

Public Function CachePath() As String

        Return reg.Users.OpenSubKey(".DEFAULT\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders").GetValue("Cache")

End Function

Abgelegt unter Registry.

Kommentare zum Snippet

 

Logge dich ein, um hier zu kommentieren!