Microsoft Windows

Microsoft® Windows™ is, unfortunately. It tortures its users and treats them like commodities that may be sold to the highest bidder, as if they (rather than Windows) were a product. More likely than not, you sometimes have to be that user. Microsoft and Windows are trademarks of the Microsoft group of companies.

Adding a Run Prompt Application Alias

Programs ("apps") that are registered as an App Paths key will be executable from the Run prompt (Win+R) without being made available in the system-wide %PATH%. For example, after importing the following registry entry, the deletesystem32.exe executable would launch after pressing Win+R and entering either of safe.exe or just safe.

[HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\safe.exe]
@="C:\\Program Files (x86)\\MegaCorp Inc.\\deletesystem32.exe"

This is half-documented on MSDN.

Forcefully Taking Permissions/Ownership for a File or Directory

The ACL system for file and directory permissions in Windows NT is very powerful, but it's also powerful enough to lock owners out of controlling their own files. When normal administrative persmissions and/or the normal ACL UI fail, e.g., if you have a broken ACL permission set, the simplest way I've found to take control back is to run icacls as the SYSTEM account (which is a "root" user of sorts).

For convenience, I start by spawning an interactive command prompt for the SYSTEM account using Sysinternals' PsExec. As an administrator account in an administrator prompt, run:

psexec -i -s cmd

Then, in the SYSTEM shell, icacls will be able to modify the ACL for any local file. If even the ownership is needed or has been lost, start by granting it:

icacls some_file_or_directory /setowner "some_user_name" /T /C

The flag /T recurses through directories and /C prints errors without halting, so this is a sort of -f. Then, you add a non-inherited ACL entry to some_file_or_directory and everything inside of it. Naturally, this will break all inherited permissions, but this is the only universal solution:

icacls some_file_or_directory /grant "OWNER RIGHTS:F" /T /C

Afterwards, the owner of each file or directory (through OWNER RIGHTS) will have full control (:F). It will then be possible to use the normal Windows ACL UI (right-click, Properties, Security, Advanced) to readjust the permissions. Reenabling inheritance afterwards is probably a good idea.