takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t
I use this as a command (MS-DOS mode) but it's not working. I can see the CLI window briefly appear when I run the command tho.
takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t
I use this as a command (MS-DOS mode) but it's not working. I can see the CLI window briefly appear when I run the command tho.
Add a pause command and you should be able to see more, e.g. error messages.
Keeping the pause line and adding echo to the start of the line to see the command being generated (instead of running the command) may also reveal part of what is going wrong.
Are you sure you should be using " instead of just " on its own? You'd normally only use " if you were running the command via something like JScript, not a basic MS-DOS Batch button.