Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Access denied when running "Create Restore Point" script

May 6, 2017 12:12PM PDT

Hi guys,

I wonder if you can help me, I am trying to run the below action in Windows Task Scheduler calling program wmic.exe

/Namespace:\\root\default Path SystemRestore Call CreateRestorePoint "Startup Restore Point", 100, 7

To troubleshoot this I ran wmic.exe and executed that script above manually and appeared with the below error:

"Executing (SystemRestore)->CreateRestorePoint()
ERROR:
Description = Access Denied"


The reason I want to use this script is because I am trying to create a scheduled task to create a restore point automatically using Windows Task Scheduler.

I have checked the below points:
- System protection is turned on

- Registry Key for system restore has been correctly inputted (source: https://www.howtogeek.com/278388/how-to-make-windows-automatically-create-a-system-restore-point-at-startup/)

- I am the only user on this PC (home PC) and am an administrator

Anyone have any ideas on what else I can check to allow this to run successfully?

Thanks in advance,
Dan

Discussion is locked

- Collapse -
Answer
Check priors.
May 6, 2017 12:30PM PDT

Remember I won't duplicate answers in prior replies like https://www.google.com/search?q=Access+denied+when+running+%22Create+Restore+Point%22+script&ie=utf-8&oe=utf-8

My thought is it's one of those or the script is running on a non-elevated context. You as the programmer will have to find a way to elevate the priveledge and tell Windows what user account to run this under.

-> In parting, Admin is not God. All accounts must obey permissions. Also, it's is DANGEROUS to be the only user. Always make a second local login admin account for a spare.

- Collapse -
thanks for your reply
May 7, 2017 2:33AM PDT

I have been researching it but cannot find the answer.

I have set my user to run the task and I have tried to find a way to resolve but I need to help at this point.

I have created another admin accounts for backup.

If you know anything, can you please give me some pointers on what else I can check?

Thanks,

- Collapse -
Re: restore point
May 7, 2017 2:43AM PDT
- Collapse -
Nod to Kees for that link.
May 7, 2017 7:39AM PDT