Switch/Toggle hidden files and folders with a simple script

Discussion in 'Discussion' started by Ghost, Nov 22, 2023.

  1. Ghost

    Ghost Forum Crapolator

    I always have to go to the control panel to do this on every install, SO I found this simple bat/cmd script that works a treat ( for me ) , here is the link to ( at the end of the post/thread ) - https://superuser.com/questions/115...-hidden-files-in-windows-through-command-line

    EDIT - I created this back in windows 7 time for a few quick right click items so it never made it to any public post ( that I remember )

    it works in a flash :cool: Added to post at bottom as for quick use/testing


    REG QUERY "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden | Find "0x2"

    IF %ERRORLEVEL% == 1 goto turnoff
    If %ERRORLEVEL% == 0 goto turnon

    goto end
    ::show hidden and system files
    :turnon
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 1 /f
    goto end

    ::hide hidden and system files
    :turnoff
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 2 /f
    REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 2 /f
    goto end

    :end
    taskkill /f /im explorer.exe
    start explorer
     

    Attached Files:

    Last edited: Nov 22, 2023
    Trouba likes this.
  2. Ghost

    Ghost Forum Crapolator

    If this could be made into a 'right click' type of usage it would be great also for that quick show/hide moment.
     
  3. Ghost

    Ghost Forum Crapolator

    I found my old 'right click' script so I will make a right click switch for this ( yea probably pointless but what the hell LOL )
     
  4. Trouba

    Trouba Administrator Staff Member

    If you use reg tweaks (like the $RegTweaks folder) in your build, you can also do the following from the Last10/11 reg tweaks file:
    Code:
    ;Enable show: Hidden Files, File Extensions, Drives without Media (for current user -- requires log off)
    [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
    "Hidden"=dword:00000001
    "HideFileExt"=dword:00000000
    "HideDrivesWithNoMedia"=dword:00000000
    "HideIcons"=dword:00000000
    ;"ShowSuperHidden"=dword:00000001
    The last entry (ShowSuperHidden) is for showing protected operating system files, so if you want those to show too you can remove the semi-colon in front of it. It's not a toggle, I know, but just in case :D
     
  5. Ghost

    Ghost Forum Crapolator

    Thanks for that @Trouba , I am working on it now I will have a working Right Click before long, and the old win 7 builder stuff has come in handy ;)
     
    Trouba likes this.
  6. Ghost

    Ghost Forum Crapolator

    Here is a quick and working Right Click _Show_Hide_SystemFilesFolders, this is nothing special but the right click add .cmd could be used for other apps and such.

    READ-ME.txt also for quick usage


    ADDED INFO - This right click could be beneficial in windows 11 to get to where you want to go without clicking 20 different things
     

    Attached Files:

    Trouba likes this.
  7. Ghost

    Ghost Forum Crapolator

    Re-upped - I forgot to change the reg entry at the end of the reg key
     

Share This Page