Answer the question
In order to leave comments, you need to log in
Why is the task scheduler throwing an error?
Task execution error 0xFFFD0000
$Path = "C:\1"
$files =( Get-ChildItem $Path -Recurse -include *.* | Where { $_.Exists } )
Send-MailMessage -from [email protected]ДОМЕН -to [email protected]ДОМЕН -Subject 'New File' -SmtpServer СМТП_СЕРВЕР -Attachments $files.PSPath
Remove-Item $Path\* -Recurse -Force
Answer the question
In order to leave comments, you need to log in
add "-ExecutionPolicy Bypass" to the arguments
or use -command "&'path to script' -scriptparameter"
instead of -file "path to script " (this is how scripts work in the scheduler for me)
The error is very likely unrelated to the contents of the script.
It is most likely that the problem occurs when parsing program startup arguments.
You need to check the task launch parameters, and then check that the script is available with these parameters (on whose behalf, for example, it is executed).
PS - I think some of the tags (Powershell and mail) are superfluous here :)
PPS - I think if you drive the error code into Google, you can find a description of the error among the already traditional garbage.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question