Powershell via Task Scheduler Doesn’t Like Spaces

I was working with a scheduled task the other day and for some reason it would not run a Powershell script I had for cleaning up old files, complaining of an exit code 2147942401 (0x80070001).

The resolution was in the parameter. The parameter passed for the script filename had spaces. It seems silly that fixed the problem but after the change.

Leave a Reply

Your email address will not be published. Required fields are marked *