To run or convert batch files externally from powershell (particularly if you wish to sign all your scheduled task scripts with a certificate) I simply create a powershell script e.g deletefolders.ps1
Input the following into the script:
cmd.exe /c "rd /s /q C:#TEMP\test1"
cmd.exe /c "rd /s /q C:#TEMP\test2"
cmd.exe /c "rd /s /q C:#TEMP\test3"
*Each command needs to be put on a new line calling cmd.exe again.
This script can now be signed and run from powershell outputing the commands to command prompt / cmd directly.
A much safer way then running batch files!