# Batch file to enable diable hidden files



## G-Stress

Hey guys, I'm looking for a way to create a simple batch file to enable disable the view of hidden files. One that would work with XP/Vista. I can think of a way to create a batch to set all/certain file types to hidden/unhidden, but can't think of a way to just enable/disable currently hidden files. Any advice is greatly appreciated.


----------



## Squashman

Not sure if this value is the same in the registry for Vista. Here is the registry value in XP.
http://www.pctools.com/guides/registry/detail/1007/


----------



## ghostdog74

attrib ??


----------



## G-Stress

Squashman said:


> Not sure if this value is the same in the registry for Vista. Here is the registry value in XP.
> http://www.pctools.com/guides/registry/detail/1007/


It's been a minute since I've created a .reg file would I just save

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\
Advanced]

as a reg file? Where I'm lost is where would I set the value at in a .reg file or .bat if possible?

@ ghostdog74

If I'm understanding properly your saying create a .bat to apply attrib +h ? Which that is what I had in mind but then I would have to set the specific destinations and files.

I'm just wanting to basically do the Folder Options --> Show hidden files, but in a .bat file, .reg file will work also.


----------



## Squashman

You can get a Vbscript from here to toggle the settings.
http://www.edbott.com/weblog/?p=692

Or you can use this reg file. Copy and paste it into a text file but rename it with a .reg extension.


Code:


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"Hidden"=dword:00000001
"HideFileExt"=dword:00000000
"ShowSuperHidden"=dword:00000001

If you want to call the registry file from a batch file you can do this.
showfiles.bat


Code:


regedit.exe /S showfiles.reg


----------



## G-Stress

Squashman said:


> You can get a Vbscript from here to toggle the settings.
> http://www.edbott.com/weblog/?p=692
> 
> Or you can use this reg file. Copy and paste it into a text file but rename it with a .reg extension.
> 
> 
> Code:
> 
> 
> Windows Registry Editor Version 5.00
> 
> [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
> "Hidden"=dword:00000001
> "HideFileExt"=dword:00000000
> "ShowSuperHidden"=dword:00000001
> 
> If you want to call the registry file from a batch file you can do this.
> showfiles.bat
> 
> 
> Code:
> 
> 
> regedit.exe /S showfiles.reg


Nice... thanks man. This is the part I was unsure about as far as creating a .reg file to import.



Code:


"Hidden"=dword:00000001
"HideFileExt"=dword:00000000
"ShowSuperHidden"=dword:00000001

I couldn't remember how to set the values. This will definitely come in handy


----------



## Squashman

Its just a matter of finding the correct registry key and then exporting it to a reg file. That is all I did.


----------



## G-Stress

Ahhh... even better I didn't even think of it that way, I was only thinking of creating it manually


----------

