We help IT Professionals succeed at work.

hide a folder in command prompt

Last Modified: 2012-05-04
hi all experts how can i hide a folder in command prompt or using any ms-dos tool .... and it's cant show from the tools options . "show all files and folders" this option cant show my folder is it possible ?? please help
i want to hide my folder but my class mate knows how to unhide the folder by clicking show all files and folders.... thats why i want to use command prompt to hide and it will not show from this option "show all files and folders". i can't use the NTFS filesystem.
Watch Question


i've read this little trick :

First make a folder in any directory you want in this case i will be using
drive C:\. Now when you get done making a new folder get into DOS and goto
the directory that you made the folder in. Now do this, type "rename" then
space then type the name of your folder then space then hold the Alt button
down and press 255 on your keypad then enter your folders name ( no space
between Alt+255 and your folder's name ). Okay..it is now hidden, try and
open it and see for yourself. If you want to unhide it just rename it from
Alt+255 folder's name to just your folder's name vice versa.

with it i can hide the name of the folder,but not the icon. i can't install tools which run setup processes,because i haven't the rights to do it. i can run only the ms-dos commands...

If you can't use NTFS or install a third party file password system, there's no DOS or WINDOWS function that can hide a folder more than "attrib +h FolderName" does.  
Yes, I know this does not help you, but get your instructor or network administrator involved in this.  If you have a valid need, she/he can get you space on a networked folder that only you can access.  If this is student one upmanship, you already gave us a good answer (NTFS) that is valid for systems you can control.  The school's computers should be protected enought to prevent it.

In NTFS you must password protect a folder and place your hidden folder inside the password protected one.  The password protected folder cannot be 100% hidden, as anyone with permission to see it's parent can do anything it's parent to unhide it that you could do to hide it.  The files inside the password protected folder will be completely hidden to anyone without the password.



i can install a third party file hiding system,because i can place the files manually in the windows/program files folders,but i can't run exe files. i can modify the windows registry,too. so i can place in the startup folder a reg file which add the line :

My computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\run

"C:\Program Files\third party file hiding system\hide.exe c:\windows\hide_folder" /stealthmode

when the pc wil be rebooted,the program will be executed in stealth mode. it should run in a command line,no one should see it...

>>First make a folder in any directory you want in this case i will be using
>>drive C:\. Now when you get done making a new folder get into DOS and goto
>>the directory that you made the folder in. Now do this, type "rename" then
>>space then type the name of your folder then space then hold the Alt button
>>down and press 255 on your keypad then enter your folders name ( no space
>>between Alt+255 and your folder's name ). Okay..it is now hidden, try and
>>open it and see for yourself. If you want to unhide it just rename it from
>>Alt+255 folder's name to just your folder's name vice versa.

I know this trick, 176, 249, 251 and 254 also work fine with it.

This trick doesn't hide the folder, it merely makes it inaccessible for windows 98 (SE included), 95, possibly ME, but not any NT computers.

The way that it works is that when Windows displays the folder it sees the ASCII part of the name and substitutes it with _ to make it visible when it tries to do anything to it, it tries to open it as if _ is actually part of its name instead of the ASCII code. So windows wont do anything because its opening a nonexistent file/folder.

command prompt responds fine because it interprets it exactly like you specify it.

This trick doesn't work with Xp computers (I tried and I failed).

BTW: About NT, if you boot up Knoppix (or any form of Linux) on the computer, it can access the password protected files too. (Not write access but there is read access.)


so lets make the situation :

the "176, 249, 251 and 254" trick doesn't works on nt computers. so i need to find another way.  
i've read that there's a way to have Windows redirect you to a different folder using CLSID values,
someone knows it ?
or that i can use the cacls commands...
or if someone knows a tool able to make hidden folders that can be launched in a command line and that works in stealth mode without icons on the taskbar.
or another way is to modify the registry values to make a folder hidden.

lemme know

If you have XP Pro (XP Home does not encrypt), you can encrypt the data needing a password to unencrypt it, so the the knoppix and several other OS's and a few utilities that can read private files will have to take that data to a cracking program to decrypt it.  

Bottom line: If you want your data private, you have to be able to lock up the PC so nobody with a CD or floppy can break into it, in addition to whatever encryption you use to protect it from other users of the same PC.  

On 98, everyone who can use the PC is "BOSS" and can rename whatever folder you can name the same way you can, regardless of tricky codes.  So they can't see the name, but there is a line in the file list that looks funky or blank, or whatever.  It would be less suspicious and more likely not found to have a "C:\WINDOWS\OPTION5" folder that would sort next to "C:\WINDOWS\OPTIONS" and most folks don't look in there for stuff anyway.

My 2ยข,


im trying to follow two ways and i ask to you to help me with them.

1) http://www.microsoft.com/WindowsXP/expertzone/tips/july02/honeycutt.asp

but dont works,why ?

now what ? u'll see a big list of some garbage value but don't
panic simple go to edit and find the name of folder u want to make
it like suppose if u want to make ur folder to MY NETWORK PLACES then
find it and it 'll show you the name on the right hand corner
and look at it thats in a folder whose key must be like
ok half work is done
now u know the CLSID value for network places. main part is here
simply go to the folder u want to lock ,right click on it and
select RENAME
give the name and after that give "." without quoets.and just copy
the key name u got in registry i mean
and press enter ! Bang u'll see ur folder as a my network places
icon click on it u'll see u network settings.but it won't show u
the actual content
now to access that folder just go to dos prompt and rename that
folder e.g (i hope u should know how to raname a File or folder in
dos )

c:>rename mask.{208D2C60-3AEA-1069-A2D7-08002B30309D} mask

now check ur folder again it 'll show you normal and clickon it to

you can create many folder icons like CONTROL PANEL, MY NEWORK

for more u'll search more u'll find .Here are some of the folders
with their CLSID values

Recycle Bin- {645FF040-5081-101B-9F08-00AA002F9554E}
Network Neighbourhood- {208D2C60-3AEA-1069-A2D7-O8002B30309D}
My Computer- {20D04FE0-3AEA-1069-A2D8-08002B30309D}
Control Panel- {21EC2020-3AEA-1069-A2DD-08002B30309D}
My Briefcase- {85BBD920-42AO-1069-A2E4-08002B30309D}
History- {FF393560-C2A7-11CF-BFF4-444553540000}
Printers- {2227A280-3AEA-1069-A2DE-O8002B0309D}
Dial-up Networking- {992CFFA0-F557-101A-88EC-00DD01CCC48}
Fonts- {BD84B380-8CA2-1069-AB1D-08000948534}

...but...my problem is not fixed.because every1 can rename Startup.{645FF040-5081-101B-9F08-00AA002F954E} in Startup. Maybe could works if .{645FF040-5081-101B-9F08-00AA002F954E} extension could be hidden. a good workaround ?
This one is on us!
(Get your first solution completely free - no credit card required)
-> "C:\Program Files\third party file hiding system\hide.exe" "c:\windows\hide_folder" /stealthmode

this is an example. i haven't found a program like this,not yet.

As stated before:  If this is a Windows 98/ME system, anyone else can re-change the registry or bypass the loading of hide.exe and be back at square one.

-> my goal is to avoid the bypass. im trying to protect the startup folder,by redirecting his content to another folder. how the registry can be re-changed if no one can place files in the startup folders ?

-> You may need to tell us your OS version to get any further.  Most of the "tricks" you mentioned above works only on WINDOWS 98,  where anyone can press escape at the logon prompt and undo anything you did

im the only admin of my computer. no one can press escape at the logon prompt. i want to stop occasional users to surf inside my startup folders when i share the whole content of my c drive
i use windows 9x,windows xp,linux,freebsd...everything...

-> IF that network share has permissions set so ONLY you can connect to it,  and IF this is an XP system, then those files will be hidden from others logging on as a side-effect, but not hidden to you ( or to them while you are logged on ) in any way.

i've changed the honeycutt script :



[Reg.Settings] HKCU,Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders,Personal,0x20000,"%PERSONAL%"
HKCU,Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders,My Pictures,0x20000,"%PICTURES%"


i've shared my c drive to every1. i've used another connection and i've surfed inside the personal and my pictures folder of my shared pc. i've been not redirected to PrintHood folder. why ?

-> You shoud NOT rename those keys, only change the values of subkeys under those keys.  Which subkey to change the value of is based on which OS version you have

there is no cls id subkey for the startup folder....

> none of that pretends to hide the original files or folders you had.  

this way should block unwanted users to surf inside my special folders.
How about dropping down to Dos i.e. run the command prompt (ms dos prompt)

Lets say you want to change a folder called c:\red to become hidden whilst in dos.

Type the command ATTRIB C:\RED +H +S  Then press enter

This will make The computer think that this folder is a hidden system folder

Job Done.

I am unsure weather or not this will work but it's all I can suggest for the time.
Might also suggest browse to a network trash share if there is one and using that, but don't leave files there to long.
You could try renaming the folder with a $ at the end.  hence, the folder 'docs' would be renames 'docs$'.  Then to access the folder you will have to either map a drive to it or go to run and enter the path to the folder so the 'docs$' folder might be c:\docs$.  Hope this helped, worked for me in Windows XP Pro SP2.

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.