Dim FileName
Dim FileNamePart
Dim FileNamePre
Dim FileNameOutput
Dim FileNameOutputTemp
Dim StrSplit
Dim WshShellCmd
Dim ArgCount
'WScript.Echo GetLocale
Set ArgObj = WScript.Arguments
ArgCount = WScript.Arguments.Count

FileName = "[新] 松本人志のコントMHK #1 - 11.11.05_part-00.flv"

If ArgCount > 0 Then
FileName = ArgObj(0)
Else
Wscript.Echo "ArgCount is 0"
'Wscript.Quit 1
End If

StrSplit = "_part-"
FileNameOutputTemp = "Temp.flv"
FileNamePre = Left(FileName ,InStr(FileName,StrSplit) - 1)
FileNameOutput = FileNamePre & ".flv"
WshShellCmd = "FlvBind.exe """ & FileNameOutputTemp & """"


Dim FileSys
Set FileSys = CreateObject("Scripting.FileSystemObject")

For i=0 to 16
FileNamePart = FileNamePre & StrSplit & Right("00" & LCase(HEX(i)) , 2 ) & ".flv"
If FileSys.FileExists(FileNamePart) Then
FileSys.MoveFile FileNamePart , i & ".flv"
WshShellCmd = WshShellCmd & " """ & i & ".flv" & """"
End If
Next

'Set WshShellCmdFile = FileSys.CreateTextFile("WshShellCmd.txt", True)
'WshShellCmdFile.WriteLine WshShellCmd
'WshShellCmdFile.Close

'Wscript.Echo WshShellCmd

Set WshShell = WScript.CreateObject("WScript.Shell")
Ret = WshShell.Run( WshShellCmd , 1, True )
If Ret = 0 Then
FileSys.MoveFile FileNameOutputTemp , FileNameOutput
Else
FileSys.DeleteFile FileNameOutputTemp
End If

For i=0 to 16
FileNamePart = FileNamePre & StrSplit & Right("00" & LCase(HEX(i)) , 2 ) & ".flv"
If FileSys.FileExists( i & ".flv" ) Then
FileSys.MoveFile i & ".flv" , FileNamePart
'FileSys.DeleteFile i & ".flv"
End If
Next

'WshShell.Run WshShellCmd , 6, True 隱藏式窗
'WScript.Echo "return -" & Ret

Set WshShell = Nothing
Set FileSys = Nothing
Set ArgObj = Nothing

abort 發表在 痞客邦 PIXNET 留言(0) 人氣()