Tip & How-To about Computers & Internet

How to hide files using the Attrib command

Attrib is a DOS command that sets or displays various file attributes. One of those attributes is the Hidden attribute, which determines whether or not a file can be viewed in a directory under normal circumstances. With the Attrib command, you are able to hide or show any non-system file, as well as view any file's current attributes.

To use Attrib, you must be at the DOS command prompt. In Windows XP, Vista, and 7, you can open a command prompt window by either typing "cmd" into the Run bar or by browsing to the Command Prompt (Start menu > All Programs > Accessories > Command Prompt). In Vista or 7, you can also type "cmd" into the Search bar.

The syntax for using Attrib to hide a file is as follows:

attrib +h

If you are currently in the directory where the file is located, you can omit typing the path. And since DOS is not case sensitive, you can use either upper or lowercase letters, or both.

If you later want to make that same file visible again, just type:

attrib -h

To view the attributes of all of the files in the current directory (even hidden files), type "attrib" by itself. Keep in mind that hiding a file will make it harder to find, but it does not by any means make it impossible. If you have sensitive or confidential data that should not be viewed by other users, protect it using encryption, permissions, and a strong user account password.

Posted by on

Computers & Internet Logo

Related Topics:

Related Questions:

2 Answers

How to Delete Read Only Files?


Turn off the read-only attribute. Right-click the file in your operating system's file browser and select the appropriate choice.

Oct 18, 2016 | Computers & Internet

1 Answer

What Is CMD Prompt For


The CMD, or Command, is used to run
DOS commands. Click Start, Run, type CMD and press Enter. At the cursor on the "DOS Screen", type ATTRIB *.*.
That will show you the attributes of the files. (Read, Archive, System and Hidden) Now type HELP. That will show you the commands you can run. CMD is very useful for deep troubleshooting.
Today, not so much because when something quits working, we just buy a new one.

Jun 06, 2012 | Computers & Internet

2 Answers

cannot find directory in commamd prompt


you want to open commamd prompt? press start+R and type cmd

Oct 26, 2010 | Computers & Internet

Not finding what you are looking for?

260 people viewed this tip

Ask a Question

Usually answered in minutes!

Top Computers & Internet Experts

Doctor PC
Doctor PC

Level 3 Expert

7733 Answers

kakima

Level 3 Expert

102366 Answers

David Payne
David Payne

Level 3 Expert

14161 Answers

Are you a Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Loading...