Windows

Hide shared folders with Windows XP Pro's Net command line tool

When you want to limit who can access your shared folders in Windows XP Pro, you can use the Net command line tool to hide your computer, and subsequently your shared folders, from other network users. Greg Shultz shows how to create a hidden share.

By sharing a folder in Windows XP Pro, it usually means that you want network users to be able to find and access the folder in the My Network Places tool. If you want to share a folder with only certain users, you can use the Net command line tool to essentially hide your computer and shared network folders.

Follow these steps to create the hidden share:

  1. Open a command prompt.
  2. Type this command: net config server /hidden:yes.
  3. Share the folder as you normally would.

If your computer is already sharing network folders, it may take up to 30 minutes for this command to take effect and hide the computer name.

Users who have access to the hidden shared folder can get to it by using the UNC name or by mapping the hidden share to a local drive letter. To unhide the computer, type
net config server /hidden:no.

Note: This tip is for Windows XP Professional only.

Miss a tip?

Check out the Windows XP archive, and catch up on our most recent Windows XP tips.

Stay on top of the latest XP tips and tricks with our free Windows XP newsletter, delivered each Thursday. Automatically sign up today!

About

Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.

12 comments
MWRMWR
MWRMWR

That word "server" worried me a little. I checked the command out on my workstation and all was well. It seems to me that this has an historic and simple meaning that the files are shared across the network and implies nothing about the OS. You will note that the syntax of this command is: NET CONFIG SERVER [/AUTODISCONNECT:time] [/SRVCOMMENT:"text"] [/HIDDEN:{YES | NO}] and that the syntax of >net config workstation /? is: NET CONFIG [SERVER | WORKSTATION] which provides a mixture of useful but readily obtainable info along with info unlikely to be of use to mortals.

?/\/\?|???\/???
?/\/\?|???\/???

...of the side effects of this command. MS KB Q314498 - Server Service Configuration and Tuning - (http://support.microsoft.com/kb/314498) states: "...if you run the net config server command in conjunction with the /autodisconnect, /srvcomment, or /hidden switches, the current values for the automatically tuned parameters are displayed and written to the registry. If you add or remove system memory, or change the server size setting (minimize, balance, or maximize), Windows does not automatically tune the Server service for your new configuration." The same applies for NT, 2000, and 2003; the article covering these operating systems is at http://support.microsoft.com/kb/128167.

bert.snijckers
bert.snijckers

Why not simply add a $ to the end of the share name? As users cannot browse (and thus see) shares of which the name ends with a $. Works for all Windows versions.

mhasf
mhasf

Wow... Good inside information! But as always, what a limitation. Why did the "engineers" at Microsoft do it that way?...

IndraGM
IndraGM

Question please. If I add $ to the end of my shared folder name, will I still be able to map a drive to that particular shared folder?

Hammer71
Hammer71

adding $ to the end of the name though only hides that specific share... which is all that you may want to do... the net command seems to hide all shares by hiding your computer ... a sledge hammer approach which may be beneficial in certain circumstances for security purposes

?/\/\?|???\/???
?/\/\?|???\/???

...things are this way because of a legacy design issue, and priorities - this has been in NET.EXE since NT 3.1. How many people use "net config server" with the params that "disable" the auto-tuning? What gets the attention - this issue, or new / more desirable features?

bryan669
bryan669

for sure! just make sure that you type in the $ with the share name. example \\office_pc\my documents$ MisterB

Walter S Ching
Walter S Ching

Yes, but you will have to type in the name of the path to the share since you will not be able to browse to it.

KenDAWG
KenDAWG

Yes you can map a drive with a $ in the share name.

onsiter
onsiter

It is all or nothing but its easy to unhide without changing the share name...

280Turbo
280Turbo

And you also must include the $ in the share name when you map to it, such as \\server\share$, or it won't be found.