Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Directory atrributes

Posted on 1998-12-16
17
198 Views
Last Modified: 2010-05-18
Is there a way, (or utility)to changes the attributes on directories only ( not the files inside). I have hundreds of directories with thousands of subdirectories that I would like to change to read only. With out going through each one.
0
Comment
Question by:wrandy
  • 6
  • 6
  • 2
  • +3
17 Comments
 

Expert Comment

by:sdczerno
ID: 1013731
The only way I know how to do this is in Explorer. Click on the Root Directory where all you sub-directories are then in the right windows select all folders and then click your right mouse on the highlighted folder(s) and check "read-only". Hope this helps.
0
 

Author Comment

by:wrandy
ID: 1013732
That is the default way, but does not flow down to all subdirectories below. This answer should have been tested before given.

0
 
LVL 5

Expert Comment

by:Jason_S
ID: 1013733
Select the directory, right click, go to Find, and hit Find now.  This will show all files, and folders under this directory. (granted you are set up to show hidden files) Select all, Right click, go to Properties, and check Read Only.

This works for me.  If it doesn't work for you, let me know.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 12

Expert Comment

by:mark2150
ID: 1013734
ATTRIB *. /S +R

0
 

Author Comment

by:wrandy
ID: 1013735
This does not flow down through subdirectories.I hve thousands of subdirectories.
0
 

Author Comment

by:wrandy
ID: 1013736
ATTRIB *. /S +R  changes all the files also. I do not want this.
0
 
LVL 2

Expert Comment

by:omsec
ID: 1013737
attrib +h DIRNAME
does that also hide the files inside the directory "DIRNAME" ?
0
 
LVL 5

Expert Comment

by:Jason_S
ID: 1013738
"Directories only"  Missed that, sorry.

Still using my method, under advanced/Of type, select Folder.  You may run into a search limit though.

Please specify opperating system, as I assumed Windows 95.
0
 
LVL 1

Expert Comment

by:Stevie_emwsys
ID: 1013739
Run Winfile from a run prompt. Select the drive in the left pane and then select the directories you want to adjust in the right pane. Click File and then Properties. You then get a box with the attributes. Change as needed. If you are adjusting hidden directories then you need to select View, By File Type, and click the Show Hidden/System files box first.
0
 
LVL 5

Expert Comment

by:Jason_S
ID: 1013740
"Directories only"  Missed that, sorry.

Still using my method, under advanced/Of type, select Folder.  You may run into a search limit though.

Please specify opperating system, as I assumed Windows 95.
0
 

Author Comment

by:wrandy
ID: 1013741
once again, this works on files in a directory, but I want only directories and subs to be changed. also, the subs go very deep and i don't wnat to select each one.
Thanks to all. but I have came up with the answer. I will post shortly.
0
 
LVL 5

Expert Comment

by:Jason_S
ID: 1013742
Maybe Im missing something. This works for me on dubdirectories.  I'll wait for your post.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1013743
I can generate a list of directories that need to be processed easily enough with:

DIR \ /AD /B /ON /-P /S > X

Having done that you'll have to use:

OPEN "X" FOR INPUT AS #1
OPEN "FIX.BAT" FOR OUTPUT AS #2
PRINT #2, "@ECHO OFF"
DO WHILE NOT EOF(1)
    LINE INPUT #1, Text
    PRINT #2, "ATTRIB " & Text & " +R"
LOOP
CLOSE
SHELL( environ("Comspec") & " /C FIX.BAT", 1)

0
 

Author Comment

by:wrandy
ID: 1013744
My bad. Jason_s got it. I overlooked running find again after going to  advanced and selecting "FOLDER" .
This does catch directories only and all subs on down.
0
 
LVL 5

Accepted Solution

by:
Jason_S earned 200 total points
ID: 1013745
Good to hear!  (I thought I was going nuts. : ) )  If you need more help, let us know.
0
 

Author Comment

by:wrandy
ID: 1013746
Great Job. Thanks to everyone. jason_s, thanks for not giving up. sometimes (in your case) you know your right, and wonder if the one on the other end is nuts.
I hope I can help others in the future.

0
 
LVL 5

Expert Comment

by:Jason_S
ID: 1013747
Were all nuts from time to time.  : P
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Issues cloning my HDD to SSD 12 90
Additional HDMI Inputs to HDTV 3 62
CPU at 100% usage, why? 27 149
BIOS update failed, laptop dead. Any options to revive the system? 19 111
A clone is a duplicate copy. Sheep have been cloned and maybe someday even people will be cloned, but disk cloning (performed by the hard drive cloning software) is a vital tool used to manage and protect data. Let’s look at what hard drive cloning …
This article outlines why you need to choose a backup solution that protects your entire environment – including your VMware ESXi and Microsoft Hyper-V virtualization hosts – not just your virtual machines.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question