Hello,
I'm currently trying to write a batch script to automatically personalize some of my settings after Windows installations. I also want to make some changes to the Windows sounds. Therefore I'm trying to take ownership of the %windir%\media folder via the command line, which I'm running with admin rights. In my Windows XP VM, where I'm using the old cacls comment, this is possible without any problems. It's not working on my real Windows 10 machine though:
And so on. The folder is owned by TrustedInstaller. I could of course get ownership via the Explorer (and I know how, I've done this before many times), but I want to get it done via a batch script/the command line. Any idea how I can do it? PowerShell is an acceptable solution, but only as a last option, I want to get it done inside the command line if possible.
I'm currently trying to write a batch script to automatically personalize some of my settings after Windows installations. I also want to make some changes to the Windows sounds. Therefore I'm trying to take ownership of the %windir%\media folder via the command line, which I'm running with admin rights. In my Windows XP VM, where I'm using the old cacls comment, this is possible without any problems. It's not working on my real Windows 10 machine though:
Code:
C:\Windows>icacls media /t /c /setowner %username%
media: Access is denied.
media\Afternoon: Access is denied.
media\Alarm01.wav: Access is denied.
media\Alarm02.wav: Access is denied.
media\Alarm03.wav: Access is denied.
media\Alarm04.wav: Access is denied.
media\Alarm05.wav: Access is denied.
media\Alarm06.wav: Access is denied.
media\Alarm07.wav: Access is denied.
And so on. The folder is owned by TrustedInstaller. I could of course get ownership via the Explorer (and I know how, I've done this before many times), but I want to get it done via a batch script/the command line. Any idea how I can do it? PowerShell is an acceptable solution, but only as a last option, I want to get it done inside the command line if possible.