asp.net script in task scheduler

I got small asp.net script what could be executed as web page

http://localhost/myscript.aspx

and I need this script to be run every 30 seconds.

I am working on windows server 2003 with IIS 6.0
I got task scheduler available, however launching
iexplorer.exe http://localhost/myscript.aspx open browser even putting JavaScript windows.close () inside page, so in a few min I will have too many browsers open

how to run it similar to Unix Lynx http://localhost/myscript.aspx > null

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Install PowerShell then you can create a task that runs the following command:

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

Method 2

I would instead start a background thread in the Application_Start event and then use a timer object to trigger the action every 30 Seconds in this background thread.

Method 3

save your vbs file,

Set WshShell = WScript.CreateObject(“WScript.Shell”)
WshShell.Run “iexplore your url”, 9

WScript.Sleep 20000 ‘ Give ie some time to load

‘Close the browser

WshShell.SendKeys “%F”

WshShell.SendKeys “C”


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x