Blu-ray.vbs

更新 2019年7月20日 发布 2018年11月5日  Windows & PC
'检查蓝光光盘目录结构完整性脚本
'作者:风云突变 (无忧脚本 - WWW.51JS.COM)

Dim SourceFolder, FSO, MSG

SourceFolder = BrowseForFolder("请选择需要检查的蓝光光盘目录", 0, 17)

If SourceFolder <> "" Then

	Dim Folder(15)
	Folder(0) = SourceFolder
	Folder(1) = "\BDMV"
	Folder(2) = "\BDMV\AUXDATA"
	Folder(3) = "\BDMV\BACKUP"
	Folder(4) = "\BDMV\BACKUP\BDJO"
	Folder(5) = "\BDMV\BACKUP\CLIPINF"
	Folder(6) = "\BDMV\BACKUP\JAR"
	Folder(7) = "\BDMV\BACKUP\PLAYLIST"
	Folder(8) = "\BDMV\BDJO"
	Folder(9) = "\BDMV\CLIPINF"
	Folder(10) = "\BDMV\JAR"
	Folder(11) = "\BDMV\META"
	Folder(12) = "\BDMV\PLAYLIST"
	Folder(13) = "\BDMV\STREAM"
	Folder(14) = "\CERTIFICATE"
	Folder(15) = "\CERTIFICATE\BACKUP"

	Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")

	For i = 1 To UBound(Folder)
		If Not FSO.FolderExists(SourceFolder & Folder(i)) Then
			FSO.CreateFolder(SourceFolder & Folder(i))
			MSG = MSG & Folder(i) & vbCrLf
		End If
	Next

	If MSG = "" Then
		MSG = SourceFolder & "目录下的蓝光光盘目录结构完整"
	Else
		MSG = "以下目录缺失并已修复" & vbCrLf & vbCrLf & MSG
	End If

Else

	MSG = "所指定的路径无效"

End If

MsgBox MSG , 64, "完成"

Function BrowseForFolder(ByVal pstrPrompt, ByVal pintBrowseType, ByVal pintLocation)
	Dim ShellObject, pstrTempFolder
	Set ShellObject = WScript.CreateObject("Shell.Application")
	On Error Resume Next
	Set pstrTempFolder = ShellObject.BrowseForFolder(0, pstrPrompt, pintBrowseType, pintLocation)
	BrowseForFolder = pstrTempFolder.ParentFolder.ParseName(pstrTempFolder.Title).Path
	If Err.Number <> 0 Then BrowseForFolder = ""
	Set pstrTempFolder = Nothing
	Set ShellObject = Nothing
End Function