Windows任务计划程序使用Powershell执行.aspx页面

我想使用Windows任务计划程序来执行我的ASP.NET网页(.aspx)。 我读了Windows PowerShell可以帮助这个。 任务调度程序中的后asp.net脚本

告诉一个命令“powershell.exe -c(new-object system.net.webclient).downloadstring(' http://localhost/myscript.aspx ')”来执行.aspx页面。 但我无法将此行添加到Windows任务计划程序(我正在使用Windows XP)

在计划任务的运行字段中:

powershell.exe -command "(new-object system.net.webclient).downloadstring('http://localhost/myscript.aspx')"

而已。

在这里输入图像描述

你可以使用你所显示的命令创建一个像task.ps1这样的powershell文件,并计划执行这个ps1文件。

这样的文件不应该包含powershell.exe命令。