Windows任务计划程序使用Powershell执行.aspx页面
问题描述:
我想使用Windows任务计划程序来执行我的ASP.NET网页(.aspx)。我读过Windows Powershell可以帮助解决这个问题。后asp.net script in task schedulerWindows任务计划程序使用Powershell执行.aspx页面
告诉 “.downloadstring powershell.exe -C(新对象system.net.webclient)( '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命令。
Windows XP没有它。 – hotcoder 2012-01-18 07:44:26
@hotcoder是的,看看我的截图。 – 2012-01-18 07:49:38
感谢Andy,但您使用的是哪个版本的Windows? – hotcoder 2012-01-18 07:53:27