forked from ccnet/CruiseControl.NET
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremoveCCNetVDir.vbs
More file actions
38 lines (27 loc) · 931 Bytes
/
Copy pathremoveCCNetVDir.vbs
File metadata and controls
38 lines (27 loc) · 931 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Option Explicit
RemoveVDir()
Function RemoveVDir()
Dim vdirName: vdirName = "ccnet"
WScript.Echo "Attempting to remove the CruiseControl.NET Web Dashboard virtual directory..."
Dim iisRoot: Set iisRoot = GetObject("IIS://localhost/W3SVC/1/ROOT")
iisRoot.Delete "IisWebVirtualDir", vdirName
' Confirm the deletion
WScript.Echo "Confirming that the Web Dashboard virtual directory has been removed."
If DoesCCNetVDirExist(vdirName) = True Then
WScript.Echo vdirName & " virtual directory removal failed."
WScript.Quit 1
End If
WScript.Echo "Virtual directory for CruiseControl.NET Web Dashboard removed successfully."
End Function
Function DoesCCNetVDirExist(vdirName)
Dim iisRoot
Set iisRoot = GetObject("IIS://localhost/W3SVC/1/ROOT")
Dim vdir
For Each vdir in iisRoot
If vdir.Name = vdirName Then
DoesCCNetVDirExist = True
Exit Function
End If
Next
DoesCCNetVDirExist = False
End Function