I am looking for a way to automatically trigger the Application_OnStart event in case the web server is automatically restarted after a failure. And not have to wait until a user hits the web server with a request.
Using the sc.exe tool I can add an action to be performaned when a given service fails
sc -failure ServiceName command= "c:\temp\restart.vbs" I am thinking I will kickoff a script that waits for the server to reboot and causes an application start.
I am wondering if there is more elegant way to kick off a command when the service starts successfully.
I was looking for an example to explain Alternate Data Stream. One needs to know ADS to understand canonlicalization issues (i.e. $DATA ASP issue) that developers need to watch for. Here is a simple example that embeds a binary in the text file.
\Create an Alternate Data Stream to hide notepad.exe inside txt file
type c:windowssystem32notepad.exe > 1.txt:1.exe
\Launch the notepad from the alternate data stream
start .1.txt:1.exe