What is the equivalent of chmod 777?

21

11

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?

Ross Rogers

Posted 2010-07-13T13:21:26.907

Reputation: 3 025

Answers

28

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

cacls myfile.txt /g everyone:f

David Remy

Posted 2010-07-13T13:21:26.907

Reputation: 1 899

Note that explicit deny entries can override this. – Joey – 2010-07-13T13:40:22.730

2Good point, replacing the /g with /p will take care of this. – David Remy – 2010-07-13T13:45:53.583

1What is cacls? -1 for not giving any infos or providing a link to the page. – Black – 2017-03-06T10:36:52.553

3Please note that from Windows 7 onwards cacls is considered deprecated by Microsoft and icacls should be used instead. – Giles Roberts – 2013-01-17T15:07:33.517

19

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.

Joey

Posted 2010-07-13T13:21:26.907

Reputation: 36 381

This still works great in Windows 10. At risk of stating the obvious, make sure you're logged in as a user with the required privileges (usually owner or admin). Easiest method is simply starting an admin console, usage at your own risk. I wouldn't recommend replacing core system files, but every once in a while your OS will decide you're not allowed access to a folder you really want access to. This command works on folders as well. – None – 2016-03-09T12:12:46.650

3

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

jrc03c

Posted 2010-07-13T13:21:26.907

Reputation: 7 626

1CACLS is deprecated. Microsoft recommends using ICACLS instead. – ctype.h – 2012-01-16T23:21:19.873

3

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

Lonnie R

Posted 2010-07-13T13:21:26.907

Reputation: 31

1

Alternatively, you could install a free Windows terminal program like MobaXterm. When you open it you will see it gives you access to your local Windows pc directories but emulates a Linux command-line-interface, offering several Linux commands based on Cygwin such as chmod.

I'm sure there are also other tabbed Windows terminal programs out there that emulate a Linux CLI. I just currently use MobaXterm. I find it useful to keep several tabs going while using the same commands across each: one for my remote Linux server, one for a VirtualBox Linux server, and one for my local Windows pc.

David Graham

Posted 2010-07-13T13:21:26.907

Reputation: 121