📊 VBA (Excel)

Check Show Hidden Files Registry Value (VBA)

Reads the Show Hidden Files registry value via WScript.Shell.RegRead and reports it in a message box — no PowerShell or reg.exe needed.

By WindowsScripting.com · 637 B
ShowHiddenFilesGlobalRegCheck.bas
Attribute VB_Name = "ShowHiddenFilesGlobalRegCheck"
Option Explicit

Public Sub ShowHiddenFilesGlobalRegCheck()
    Dim wsh As Object
    Dim regPath As String
    Dim value As Variant

    Set wsh = CreateObject("WScript.Shell")
    regPath = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Hidden"

    On Error Resume Next
    value = wsh.RegRead(regPath)
    On Error GoTo 0

    If IsEmpty(value) Then
        MsgBox "Value not set:" & vbCrLf & regPath, vbExclamation, "Show Hidden Files"
    Else
        MsgBox "Show Hidden Files" & vbCrLf & regPath & " = " & value, vbInformation
    End If
End Sub