We help IT Professionals succeed at work.
Get Started

batch file to make all sub-folders and their files writable

3,091 Views
Last Modified: 2012-05-09
Hi, I'm not very good on writing batch files for Windows so please bear with me. What I want is a batch file which will make all sub-folders and their files writable.

The batch file would hold the paths to the directories I'd like to change. Something like:

c:\temp\folder1\
c:\temp\folder2\
c:\temp\folder3\subfolder1\
c:\temp\folder3\subfolder3\

Where I want folder1 and folder2 and all of their files and subfolders (and all of their folders and files, and so on) to be readable. And, for the next two, I'd only want subfolder1 and subfolder2 and all of their folders and files, and so on, to be readable. I wouldn't want c:\temp\folder3\subfolder2\ to be touched.

I know this sounds odd but this is how I need it to work. I have hundreds of files in hundreds of folders and instead of manually selecting the properties of each folder and changing the read\write check box it would be really nice to be able to just run a batch file. I know I can easily do this in Unix/Linux with chmod. I just don't know Windows scripting.

I'd like to be able to edit the batch file, add all of the directory paths that I need changed, save and close the file and run it. Maybe have it so that it doesn't dump out all of the files that are being updated.

Anyway, if anyone can help out, I'd appreciate it.

Thanks,
biglarrrr
Comment
Watch Question
Engineer
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 2 Answers and 7 Comments.
See Answers
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
Ask ANY Question

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

  • Troubleshooting
  • Research
  • Professional Opinions
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