Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to replace notepad.exe with notepad2.exe, but I'm getting UAC permission issues when I try to open a file with the replacement notepad2.exe. I have to open notepad2.exe as admin.

How can I perform a Windows 7 equivalent of the linux chmod 777 on the file?

share|improve this question
add comment

4 Answers

up vote 9 down vote accepted

Using cacls you can do this same type thing, example.

cacls myfile.txt /g everyone:f
share|improve this answer
    
Note that explicit deny entries can override this. –  Joey Jul 13 '10 at 13:40
2  
Good point, replacing the /g with /p will take care of this. –  David Remy Jul 13 '10 at 13:45
    
That worked! Thanks! –  Ross Rogers Jul 13 '10 at 16:17
    
Please note that from Windows 7 onwards cacls is considered deprecated by Microsoft and icacls should be used instead. –  Giles Roberts Jan 17 '13 at 15:07
add comment

Roughly:

icacls notepad.exe /grant Everyone:F

Note that this isn't exactly the same as deny ACL entries override allow entries, so if there are any deny ones you may need to remove them.

Generally, I honestly have to question the motives of what you are attempting to do. There should never be a reason to replace core operating system files with other ones.

You can easily associate text files with Notepad2 without replacing notepad.exe which should be the preferred way of dealing with this.

share|improve this answer
1  
+1, great point about changing associations –  jrista Jul 13 '10 at 21:27
add comment

You can change the permissions from the command line via this information, although I personally find that the GUI permission controls are pretty easy to understand.

You can use it as follows:

CACLS files /e /p {USERNAME}:{PERMISSION}

Where:

  • /p : Set new permission
  • /e : Edit permission and kept old permission as it is i.e. edit ACL instead of replacing it.
  • {USERNAME} : Name of user
  • {PERMISSION} : Permission can be: R - Read W - Write C - Change (write) F - Full control
share|improve this answer
    
CACLS is deprecated. Microsoft recommends using ICACLS instead. –  ctype.h Jan 16 '12 at 23:21
add comment

This may work, tailor your command line as needed:

Step 1 - Open cmd window with admin privileges

Step 2 - to take ownership of contents of "picts" directory

     takeown /f C:\picts\* /r

Step 3 - to change permissions to "everyone" of contents of "picts" directory

     icacls C:\picts /grant Everyone:F /t
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.