Dim Args, Wsh, Fs Set Args = WScript.Arguments If Args.Count <= 0 Then Set Args = Nothing Wscript.Quit End If Set Wsh = WScript.CreateObject("WScript.Shell") Set Fs = WScript.CreateObject("Scripting.FileSystemObject") Dim sTitle, vbSp, vbTc, vbCt, vbWt, vbTs, vbCs Dim tFile, bE, bF, tR, rE, sF, cF, rF, oF, pTarget Const vbWq = """" Const Enc = "C:\Program Files\Windows Script Encoder\screnc.exe" sTitle = Fs.GetBaseName(Wscript.ScriptName) Start = Wsh.PopUp("ConvertStart?",15,sTitle,33) If Start = -1 Or Start = 2 Then Set Args = Nothing Set Fs = Nothing Set Wsh = Nothing Wscript.Quit End If vbSp = " " vbTc = vbTab & vbCrlf vbCt = vbCrlf & vbTab vbWt = vbWq & vbTab vbTs = String(2,vbTab) vbCs = String(2,vbCrLf) For iC = 0 To Args.count - 1 tFiles = Args(iC) If Fs.FileExists(tFiles) then bE = Lcase(Fs.GetExtensionName(tFiles)) If bE = "vbs" Or bE = "js" Then bF = Fs.GetBaseName(tFiles) tR = Fs.GetParentFolderName(tFiles) rE = "." & Left(bE,2) & "e" sF = vbWq & tFiles & vbWq cF = Fs.BuildPath(tR,bF & rE) If Fs.FileExists(cF) Then rF = bF & " " & iDT(""," ","",0) & rE Set oF = Fs.GetFile(cF) oF.Name = rF Set oF = Nothing End If pTarget = vbWq & Enc & vbWq & " " & sF & " " & vbWq & cF & vbWq Wsh.Run pTarget, 0 End If End If Next Set Args = Nothing Set Fs = Nothing Wsh.PopUp "Encoded",5,sTitle Set Wsh = Nothing Wscript.Quit Public Function iDT(dSplitter,dtSeparater,tSplitter,Control) Dim nX, nD, nS, strHMS, sResult nX = Now() nD = FormatDateTime(Date(),0) nS = ":" & Split(CStr(FormatDateTime(nX,3)),":")(2) strHMS = FormatDateTime(nX,4) & nS If tSplitter = ":" Then Else strHMS = Replace(strHMS,":",tSplitter) End If sResult = Cstr(Replace(nD,"/",dSplitter)) & "*" & strHMS If Control = 1 Then iDT = Split(sResult,"*") Else iDT = Replace(sResult,"*",dtSeparater) End If End Function
|
0 件のコメント:
コメントを投稿
注: コメントを投稿できるのは、このブログのメンバーだけです。