PDA

View Full Version : Shortcut to Show/Hide Files



Jester
24-08-2002, 12:51 PM
Hiya

Can anyone suggest a shortcut key or batch file that will turn on or off the "show hidden or system files" attribute?

At the moment I open explorer, go to tools, folder options, view, and either click show all files, then repeat the procedure to hide hidden or system files, but this is long-winded and wonder if I could use a desktop or keyboard shortcut.

Using Win98SE.

Thanks

:D
J.

Graham Petrie
24-08-2002, 02:45 PM
I don't know if you can toggle the diplay property, but you can toggle whethre the files are hidden or not.

From the command prompt:

To remove hidden attribute

C:\>attrib -h "path"

To add hidden attribute

C:\>attrib +h "path"

I don't think this is what you want though is it?

G P

tweak\'e
24-08-2002, 03:53 PM
why bother at all???

no1 sircuity feature is to show all files.

Graham L
24-08-2002, 03:58 PM
... and extensions, so you see .bmp.exe etc.

I have hide.bat and unhide.bat to do GP's trick. I like to have the C:\ directory appearing empty on DOS machines. It also protects against accidental file deletions. (I have the BIOS setup program on my old laptop hidden -- it's there, but can't be deleted).

Terry Porritt
24-08-2002, 04:07 PM
It would not be easy to do. As far as I can see you would need to make a .reg file or a script file to modify the registry settings at:
HKEY_LOCAL_MACHINE\software\microsoft\windows\curr entversion\explorer\advanced\folder\
and in that last folder key are the sub keys for the settings you want.

As Tweak'e says, is it worth it?

The Start button gives very slightly faster access to Folder Options.

Jester
24-08-2002, 04:08 PM
Thanks for the suggestions so far.

I have the file extensions showing, but there are files and folders that I set as hidden, mainly so the kids don't mess with them, word docs, a favourites folder, shortcuts to some games they aren't to play without supervision .. that sort of thing. I am not after password protection or anything like that.

I also prefer to have system and hidden files stay hidden when they are on the PC, and have never had an issue as far as security goes.

Basically I want a quicker way to show hidden files and folders, thanks

:D
J.

Jester
24-08-2002, 04:15 PM
Thanks Terry - I hadn't seen the folder options icon under Start/Settings before.

I have a Control Panel Icon on my Quick Launch Bar ... now, if I remember what I did to get the control panel icon there (doesn't drag off the the settings menu), I could get the Folder Options Icon there too ....

Graham L
24-08-2002, 04:15 PM
What about a batch file which has the appropriate options to show the hidden/system ones. (check with "dir/?" to see the options). I know this does not allow you to click on things once you have found them. I suspect that MS don't want life to be easy ;-) --- you are wanting to do something which they, in their wisdom, don't think is needed.

BarryMcQ
24-08-2002, 04:45 PM
The easiest way to do this is IMO, to create to reg files.
The first setting the option to show all files (then export it to a file).
The second setting the option to hide all files(then export this to a file.

Of course you then have to rely on your kids not to execute these programs. It does work however, I use this at work to disable/enable my proxy settings.

I can't remember which registy setting is involved in this however Terry seems to have it right ;-)

Terry Porritt
24-08-2002, 05:05 PM
If it wasnt for the kids, Barrys suggestion would be ideal, you could have shortcuts to the reg files, one for 'on' and one for 'off'. What ever you do the kids will find a way round it :)

antmannz
24-08-2002, 08:12 PM
You could have a single Windows script file to detect the current state of the registry key and swap it to the other state.

You could probably also use a plain text InputBox as a password-type protection (except it wouldn't have *****'s).

If someone wants to grab the reg settings, I could probably post the complete code over the next couple of days.

parry
25-08-2002, 01:42 PM
Those inquisitive kids aye :-)

Well if your that desparate then download a program that hides folders. Magic Folders does this and password protects so you cant unhide without password.

http://www.tucows.com/system/preview/256596.html

Terry Porritt
25-08-2002, 02:24 PM
Here is an update on the registry locations for the switches that hide/unhide files extensions etc.
In this key below, the same as mentioned above, is just the information for the checked, unchecked and default values, together with the text that appears in the Folder Options boxes:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Curr entversion\explorer\Advanced\Folder
and then there is a sub key Hidden with 3 subkeys, NOHIDDEN, NOHIDORSYS, SHOWALL. The default value for all these 3 is (0), and the checked values are (2), (0), (1) respectively.

The next subkey of Folder is HideFileExt, and the checked, unchecked, and default values are (1), (0), (1) respectively.

These values tell you what to change in this key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntversion\Explorer\Advanced\
In the right hand pane are listed the features such as Hidden, and HideFileExt , and the data values that be be switched from 0 to 1 etc.

If you manually change the values, eg HideFileExt, the file extensions change immediately from showing to hidden and vice versa.

One thing I cant see is a separate value for hiding system files.

Without actually doing all the work, the reg file way would be to export this key to a reg file, then make another with the switches changed.

Else antman may be able to write a script file.

This is the exported Advanced key reg file on my set up:
REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Windows\Curre ntVersion\Explorer\Advanced]
"Hidden"=dword:00000001
"ShowCompColor"=dword:00000000
"HideFileExt"=dword:00000000
"DontPrettyPath"=dword:00000000
"ShowInfoTip"=dword:00000001
"HideIcons"=dword:00000000
"ShowAttribCol"=dword:00000001
"MapNetDrvBtn"=dword:00000000
"ClassicViewState"=dword:00000000
"CheckedSCDlg"=dword:00000001

I hope this makes some sense, but I dont feel inclined to go further :)

antmannz
25-08-2002, 07:04 PM
Thanks for that Terry. :)

Jester, copy and paste the following bold text into Notepad:


pWord = "password"

If InputBox("Please enter your password:","Password") = pWord Then

Set sh = CreateObject("WScript.Shell")
theKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Exp lorer\Advanced\Hidden"
setHidden = sh.RegRead(theKey)

If setHidden = 1 Then
setHidden = 0
MsgBox "System and hidden files will no longer appear in Explorer.",64,"Hidden File Exchange"
Else
setHidden = 1
MsgBox "System and hidden files will appear in Explorer.",64,"Hidden File Exchange"
End If

sh.RegWrite theKey,setHidden,"REG_DWORD"
Set sh = Nothing

End If


The very first line sets the password. You can change "password" to anything you like, just make sure the speech marks remain.

Save the file to your desktop (or somewhere). You can call it anything you like as long as it has a .vbs extension on the end of it. It's icon should be a page with a blue scroll on it.

Double-click this icon to swap between hidden or not. You will need to enter the correct password for the swap to work.

antmannz
25-08-2002, 07:11 PM
Oops, forgot to say you might want to place the file into your windows folder and put a shortcut to it on the desktop. :)