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?
5 Answers
Using cacls you can do this same type thing, example.
cacls myfile.txt /g everyone:f 4 Roughly:
icacls notepad.exe /grant Everyone:FNote 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.
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\* /rStep 3 - to change permissions to "everyone" of contents of "picts" directory
icacls C:\picts /grant Everyone:F /t 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
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.