1
votes

I want to use Windows Task Scheduler to execute my ASP.NET web page (.aspx). I read that Windows Powershell can help in this. The post asp.net script in task scheduler

tells a command "powershell.exe -c (new-object system.net.webclient).downloadstring('http://localhost/myscript.aspx')" to execute .aspx page. But I'm unable to add this line into Windows Task Scheduler, (I'm using Windows XP)

2

2 Answers

1
votes

In the run field of the scheduled task:

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

That's it.

enter image description here

0
votes

You can create a powershell file like task.ps1 with the command you have shown and schedule execution of this ps1 file.

Such file should not contain powershell.exe command.