I have a file that's created by a program, and apparently an interaction with the system and Google Backup & Sync somehow scrambles the owner and permissions of the file. (The owner shows up as either "Unknown" or "Unable to display current owner", depending on where I look at it.)
I need to reclaim ownership of the file.
The standard method (from the File Explorer right click, Properties, Security tab, Advanced, Change Owner) doesn't work because I don't have permission to do that. Basically I need super user access on my own system so I can override what the OS thinks and actually administrate the file.
Anyone got a clue? Rebooting seems to clear the issue but that's a crappy solution. I have a Cygwin shell on this system if that helps. I'd prefer to not have to download any special utilities unless the source is very trustworthy.
Edit The problem re-occured. So far I'm not able to set the owner of the offending files:
C:\Users\Brenden>icacls "C:\Users\Brenden\Google Drive\proj\tempj8\build \classes\quicktest\AbstractTest.class" /SETOWNER "%username%" /c
C:\Users\Brenden\Google Drive\proj\tempj8\build\classes\quicktest\AbstractTest.class: Access is denied.
Successfully processed 0 files; Failed processing 1 files
C:\Users\Brenden>
This command fails too:
C:\WINDOWS\system32>takeown /F "C:\Users\Brenden\Google Drive\proj\tempj8\build\classes\quicktest\AbstractTest.class"
ERROR: Access is denied.
C:\WINDOWS\system32>

icacls "C:\folder\path\file.txt" /SETOWNER "%username%" /Cand thentakeown /F "C:\folder\path\file.txt".... If this helps, tag me back as@PimpJuiceITand I'll add this information along with some additional detail plus some reference sources for further learning. – Vomit IT - Chunky Mess Style Jul 11 '18 at 02:30takeownby itself in a command prompt and it fails also. – markspace Oct 10 '18 at 00:57takeown /f "C:\Users\Brenden\Google Drive\*.*" /r /a /d yand thenICACLS "C:\Users\Brenden\Google Drive\*.*" /reset /T /C /L /Qmay help but look over all the thread and what people say does work for some. It's likely a security setting at a higher level up parent folder wise that needs to be reset or whatever but not sure if you could disable inheritance from"C:\Users\Brenden\Google Drive\and then set the security but another thought I had. – Vomit IT - Chunky Mess Style Oct 10 '18 at 02:14