As an alternate method and what I have done for years, you can let CCleaner do the job for you. Here is the command and a description:
CCleaner.exe /AUTO /SHUTDOWN
CCleaner runs silently and automatically, using the current set of saved options to clean the PC. Windows then shuts down automatically..
Note: You cannot run /SHUTDOWN by itself. It must be preceded by /AUTO.
I put that command in a batch file and placed it on my C: root. Then created a shortcut to it and placed it on my Quick Launch toolbar right next to the Start Button.
I keep CCleaner set with all the Custom Clean options that I consider useful yet safe and it stays that way. With that batch file as my daily shutdown, I get a daily cleaning of whatever crap has been accummulated that day. A two birds with one stone method. Actually 3 birds since it takes a few seconds for the CCleaner to run, I have time to shut off the light and make it to the bed before the monitor goes off and leaves me in the dark.
ps. If you haven't added Quick Launch to your toolbar yet, it's easy done.
Add Quick Launch to Win10