Saturday, August 30, 2014

windows - batch script that grants admin rights and goes through all files and folders

I have this, pretty sure its a little harsh but does the job, gives me all the rights to the files and folders on a drive when run on a drive, now I need help getting it to go into sub directories, so I dont need to copy the bat script inside every folder and have to run it.


takeown /f *
icacls * /grant Administrator:F
icacls * /grant Administrators:F
icacls * /grant SYSTEM:F
icacls * /grant "Authenticated Users":F

How would I get it to traverse the drive recursively?

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...