2012-01-18 81 views
1

我想使用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)

回答

1

在計劃任務的運行領域:

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

就是這樣。

enter image description here

+0

Windows XP沒有它。 – hotcoder 2012-01-18 07:44:26

+0

@hotcoder是的,看看我的截圖。 – 2012-01-18 07:49:38

+0

感謝Andy,但您使用的是哪個版本的Windows? – hotcoder 2012-01-18 07:53:27

0

您可以使用所顯示的命令創建一個像task.ps1一樣的powershell文件,並計劃執行此ps1文件。

這樣的文件不應該包含powershell.exe命令。

相關問題