Verify the Status of a Web Directory Application

Retrieves the status of the Web application in the W3SVC/2142295254/root/aspnet_client_folder directory.

VBScript Code


strComputer = "LocalHost"
Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")
strStatus = objIIS.AppGetStatus2
 
If strStatus = 2 Then
    Wscript.Echo "The application is running."
ElseIf strStatus = 3 Then
    Wscript.Echo "The application is stopped."
Else
    Wscript.Echo "The status of this application could not be determined."
End If