Set hidden attribute alll files directories starting with . (dot)

  • Thread starter inevercheckthisaddress
  • Start date
I

inevercheckthisaddress

To my Linux orientated mind the command

attrib +H .*

Should set the hidden attribute on all files and directories in the
current working directory who's name begins with a .
(E.g. .bashrc .kde .mozilla .dmrc) But it doesn't, it only affects the
files and not the directories. Can anyone tell me, a virtual DOS
illiterate, what command I need to use to set the hidden attribute on
all files AND directories who's name begins with a . ?

thanks,

mike
 
T

Tom Porterfield

To my Linux orientated mind the command

attrib +H .*

Should set the hidden attribute on all files and directories in the
current working directory who's name begins with a .
(E.g. .bashrc .kde .mozilla .dmrc) But it doesn't, it only affects the
files and not the directories. Can anyone tell me, a virtual DOS
illiterate, what command I need to use to set the hidden attribute on
all files AND directories who's name begins with a . ?

You need to be careful as it will do current folder and sub-folders, but the
following will work:

attrib /d /s +h .*

The /d tells it to process folders as well (by default it only does files as
you have seen) but you have to use /d in combination with /s - which tells
it to process current folder and sub-folders.
 
I

inevercheckthisaddress

You need to be careful as it will do current folder and sub-folders, but the
following will work:

attrib /d /s +h .*

The /d tells it to process folders as well (by default it only does files as
you have seen) but you have to use /d in combination with /s - which tells

That works, thanks, but it's quite slow. Processing the sub folders
isn't needed, so a command that only affects the current working
directory would be faster and neater.

I want to run the command as a part of a script that gets run when a
user logs in to a Windows XP machine so the speed matters. I have a
set up where I have the same network stored home directory on my Linux
machine as I do on my XP machine and I don't want all the Linux
configuration files and directories cluttering up the Windows Explorer
view. (This is both an asthetics and a 'don't accidently sekect then
delete then' thing. I have no control over the server the home dir is
stored on and am told there is no way to make the file server hide the
relevant files when exporting the home dir to a Window machine.)

thanks,

mike
 
T

Tim Slattery

"(e-mail address removed)"
To my Linux orientated mind the command

attrib +H .*

Should set the hidden attribute on all files and directories in the
current working directory who's name begins with a .
(E.g. .bashrc .kde .mozilla .dmrc) But it doesn't, it only affects the
files and not the directories. Can anyone tell me, a virtual DOS
illiterate, what command I need to use to set the hidden attribute on
all files AND directories who's name begins with a . ?

When in doubt about a command-line command, type it in followed by /?.

attrib /?

That gets you the help screen which explains all the flags and
options. In this case, it says that the /D option causes it to process
folders as well as files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top