Search code examples
cmdwindows-10taskaccess-denied

Can't enable/disable a custom task neither from cmd nor with .bat/.vbs files


On another computer running win7 Pro i had no issue and i was using my.bat file with success. Now on my new win10 Home computer i get this error:

C:\Users\User>schtasks /change /tn "AlarmClockEarly" /ENABLE

ERROR: Access is denied.

But if i run the actual state of the task (for example if it is already disabled) i get this:

INFO: Scheduled task "AlarmClockEarly" has already been disabled. SUCCESS: The parameters of scheduled task "AlarmClockEarly" have been changed.

The task as you can see is a custom made and i don't try to mess with Windows like disabling Updates or something plus i already checked the run with highest priviledges

I run cmd as an Administrator

I am already the Admin account in this PC

I also tried running the command and the .bat itself from the place it is stored C:\Users\User\Scripts>

Can't remember how many things i tried while searching for a solution. So you are my best hope and thank you in advance.


Solution

  • Well i found the solution and for anyone searching the same you ll have to go to C:\windows\system32 then find cmd and go to Properties -> Security. While SYSTEM is highlighted press Advanced at the bottom right and change the Owner from whatever to your account.