Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add dot-hide version 1.0.0 #471

Merged
merged 2 commits into from
Jan 12, 2024
Merged

add dot-hide version 1.0.0 #471

merged 2 commits into from
Jan 12, 2024

Conversation

realgam3
Copy link
Contributor

No description provided.

@m417z m417z merged commit 3d38cbf into ramensoftware:main Jan 12, 2024
1 check passed
@m417z
Copy link
Member

m417z commented Jan 12, 2024

Congratulations on your first mod! 🎉

@vfmatzkin
Copy link

It would be amazing to have also a shortcut such as Ctrl+H or a context menu entry to toggle the vistibility of hidden files..

This PowerShell script kind of does that but I wish we could have this integrated in this mod (I associated it with a PowerToys keyboard shortcut):

# Define the registry path and the property name
$regPath = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"
$propertyName = "Hidden"

# Get the current value of the "Hidden" property
$currentValue = Get-ItemProperty -Path $regPath -Name $propertyName | Select-Object -ExpandProperty $propertyName

# Toggle the "Hidden" property value (1 = show hidden files, 2 = don't show hidden files)
$newValue = if ($currentValue -eq 2) { 1 } else { 2 }

# Set the new value
Set-ItemProperty -Path $regPath -Name $propertyName -Value $newValue

# Refresh Explorer to apply changes immediately
$signature = '[DllImport("shell32.dll")] public static extern void SHChangeNotify(int wEventId, uint uFlags, IntPtr dwItem1, IntPtr dwItem2);'
Add-Type -MemberDefinition $signature -Namespace WinAPI -Name Shell32
[WinAPI.Shell32]::SHChangeNotify(0x8000000, 0x1000, [IntPtr]::Zero, [IntPtr]::Zero)

# Send F5 (refresh) command to all open Explorer windows
$explorerWindows = New-Object -ComObject Shell.Application
foreach ($window in $explorerWindows.Windows()) {
    if ($window.Name -eq "File Explorer") {
        $window.Refresh()
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants