Sunday, October 26, 2008

How to Hide a File in Vista or XP

How to Hide a Windows Notepad File

Why would you want to hide files on your computer? I don't know about you but I have a lot, and I mean a lot, of passwords to keep up with. Maybe you just keep all of your passwords written down on paper next to your computer. I'm guilty of that myself. However, there are some passwords like the ones to my bank account and my credit cards that I don't feel comfortable having hard copies of lying around. I have them memorized but I want a copy of them someplace other than my cerebral cortex so I have them hidden in a text file on my hard drive.

The NTFS file system in all versions of Windows Vista and XP supports something called Alternate Data Streams. So this will won't work in Windows 98 which uses FAT 32. I just tested this on my laptop running Vista Home Premium and it does work. I've been using it on my XP machine for years now.

This is really neat! And it's very simple and easy to do.

Go to the command prompt. I know you know how but ... hold down the Windows Key and type r and then type cmd in the run box and hit the Enter key. Or you could click the Start button and click Run from there and type cmd in the box and hit your Enter key. Same thing. There are lots of ways to get to the Command prompt.

You should now be at C:\Users\Your Name> or C:\Users\Owner> but wherever you are that is where you're about to create this secret text file. So now all you need to do is type: notepad SomeFile.txt:SecretWord and hit the Enter key. But before you do that read the rest of this first.

Of course it doesn't matter what you name the file you're about to create and it doesn't matter what letters or symbols you use after the colon. I just used SecretWord after the colon as an example. But the syntax is important. Type notepad without a space at the prompt then a space and then SomeFile.txt:YourSecretWord all without any spaces.

When you hit Enter, Windows will send up a box that says "Cannot find the C:\Users\Owner\SomeFile.txt:SecretWord.txt file. Do you want to create a new file? So click Yes. When NotePad opens (and it will) put whatever you want to keep private in it and save it and close it just like you would any other document.

Now here's the cool part. In regular ol' Windows, go to C:\Users\Owner, or wherever you just created this NotePad document and find the document. It will be there titled SomeFile.txt. or whatever you decided to call it. Now click it open. Wow! its blank! O.K. so type some gibberish in it. Anyone who finds this file and opens it will see the gibberish.

To access your secret file go back the command prompt (Ctrl + r then type cmd in the box and hit Enter) and type: notepad SomeFile.txt:SecretWord and hit Enter and there's your hidden file without the gibberish. You can edit it any way you like. Notice how the Title bar reads: SomeFile.txt:SecretWord.txt.

Neat huh? Sure you could use encryption or password-protect a compressed file but this is one of only two ways I know to make a file completely disappear in Windows without having to buy and use some expensive third party software. The way I look at it is, this is way better than encryption. Because unless you know the password that comes after the colon in the command prompt you ain't gonna get to this file.

How to Hide a File Inside a Jpeg

You can also hide a file inside a photograph, a jpeg file to be precise. This method of hiding a file is not nearly so elegant and simple as the above method of hiding a file called Alternate Data Streams. This method does have a couple of advantages over Alternate Data Streams in that this method is portable. You could transport this file to another machine and view the hidden file there. And you can hide several files of any type, not just text files, in one jpeg.

Here's how to hide a file in a jpeg.

Create a folder on the Root drive called "test" (If you don't know how to do that, don't worry. I'll explain it later.) and move the text file you want to hide (We'll call it "secrete.txt) into this folder along with any regular jpeg (We'll call this "regular.jpg"). Oh, one tiny thing I failed to mention is, you're going need a copy of WinRAR. WinRAR is a file compressor sort of like WinZip. You can get a free copy at If you can't find a free copy there just Google "free winrar" and find someplace where you can download it for free. Don't pay for it.

Now in the folder where the jpeg and the file you want to hide reside, right-click the file to be hidden and click "add to new archive" and type a name for the new .rar file. Let's name it "secrete.txt.rar". Now you'll have three files in your folder: the jpeg, the original file to be hidden and the new .rar file.

Now for the magic. Go to a MS-DOS command prompt by typing cmd in the Run box. Remember how we did that earlier? You hold down the Ctrl key and type the letter r and then type cmd into the run box. You should be at C:\Users\Your Name> or C:\Users\Owner> so type "cd\" without the quotes, of course, to get to the Root drive where the folder is. Now type "cd test" and the prompt should read C:\test> and be blinking waiting for you to type so type this without the quotes "copy /b regular.jpg + secrete.txt.rar newpic.jpg" and hit the Enter key. You're done!

Now if you go to the file in Windows and click it open you just see a normal jpeg picture. But if you right-click it and open it with WinRAR and choose the option "all files" you'll see your secrete.txt file that will open like any other file.

Now some explanation.

There two ways to create a directory (folder) on the Root drive. You can open Windows Explorer (not Internet Explorer) by holding down the Windows key (the one to the left of the space bar between Ctrl and Alt) and typing the letter e. Now click the C: disk (that's the Root drive we're looking for) in the left window pane to highlight it and all of C:'s files and folders materialize in the larger right window pane. Right-clock on any empty spot in this larger pane and hold your mouse on New. In the drop box that comes up from this action, mouse up to Folders and click it and name the new folder "test".

The geek way to do the same thing is to go to the command prompt and get to the root drive there (see above) and at the prompt that reads C:\> type "md test" and hit the Enter key.

In MS-DOS md means make directory, cd means change directory so the command "cd test" means change to the "test" directory and the command "md test" means make a directory named "test". "copy /b regular.jpg + secrete.txt.rar newpic.jpg" means copy both of these files and put them both in a new file named newpic.jpg. The /b part is a DOS switch that tells DOS "oh, by the way, we want everything to be copied into binary code". Don't worry about what that means, just as long as you know that this trick won't work without the /b switch. Oh, and typing "cd\" means "change directory to the Root directory".

So there you have it. Those are the only two ways I know to completely hide a file in Windows XP and Vista. The second method, hiding a file in a jpeg, will work in earlier versions of Windows as well, like Windows 98, 98SE, Millennium, even Windows 95.

If you know of any other way to hide files in Windows, or if you have any questions or comments about anything in this post or any other posts to this blog, email me at and I will get back to you. If you have a Gmail account you could leave a comment at the bottom of this post and I'll respond to that too.

Don't forget to visit my Website at And if that's how you got here in the first place, hit your Back button and look around.

1 comment:

Scoroncocolo said...
This comment has been removed by the author.