Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Changing permissions via the command prompt


  • Please log in to reply

#1
diggeryo

diggeryo

    Member

  • Member
  • PipPipPip
  • 354 posts
I am running Windows 7 Enterprise 64-bit with Service Pack 1 and all updates installed.

I normally manually edit the permissions for the LINKS folder (found in C:\Users\USER NAME\ ), so I don't accidentally delete a shortcut under the Links pane in Explorer.

To do this, I navigate to the USER NAME folder, right click on LINKS, choose Properties, Security tab, Advanced, Change Permissions, click on my USER NAME, then Edit, then I check the boxes for DENY next to "Delete Subfolders and Files" and "Delete."

Anytime I want to actually delete a shortcut, though, I need to reverse the process, make my changes, then redo the process. Since I edit the permissions of this folder on more than I computer, it can be very time consuming.

So, to save me time, I was trying to write two batch files: one to use to add the deny permissions and one to use to take them away.

I've discovered the ICALCS command and Windows' environmental variables, and have been playing around with them to try to get them to do what I want. But I can't quite figure it out.

Can anyone offer insight? Thanks.
  • 0

Advertisements


#2
Essexboy

Essexboy

    GeekU Moderator

  • Retired Staff
  • 69,964 posts
There is a registry edit for 7 that will enable a right click take ownership option... But not for the other way around though
  • 0

#3
diggeryo

diggeryo

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 354 posts
Ok, I figured some of this out.

I am running the following command in a batch file:

icacls "%userprofile%"\Links\ /deny "%USERNAME%":(OI)(CI)(DC,D)

However, this has the unintended consequence of making the Links folder inaccessible. And I can't figure out why. Because when I look at the permissions under the folder's security tab, they look exactly like if I were to edit them manually.

I should also add that after running the batch file and having the Links folder become inaccessible, if I then do a "fake edit" under the folder's security tab--i.e. check one check box, but then uncheck it, and click save--the Links folder does become as intended (accessible to enter, but deleting not allowed).

Can anyone shed any light on this?

Thanks.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP