肿么没Any2Bat呢??
PS:我转载个,Any2Bat超慢
下面VBS- Set fso = CreateObject("Scripting.FileSystemObject")
- Set shl = CreateObject("WScript.Shell")
- Set xml = CreateObject("Microsoft.XMLDOM")
- Set stm = CreateObject("ADODB.Stream")
-
- Set arg = WScript.Arguments
- If arg.Count = 0 Then WScript.Quit
- If Not fso.FileExists(arg(0)) Then WScript.Quit
-
- Set f = fso.GetFile(arg(0))
- rr = shl.Run("makecab.exe """ & f.Path & """ """ & f.Name & ".cab""", 0, True)
- If rr <> 0 Then WScript.Quit
-
- Set el = xml.createElement("tmp")
- el.dataType = "bin.base64"
- stm.Open : stm.Type = 1
- stm.LoadFromFile f.Name & ".cab"
- el.nodeTypedValue = stm.Read
- txt = Replace(el.text, vbLf, ">>CAB" & vbNewLine & "@echo ")
- stm.Close
- fso.DeleteFile f.Name & ".cab"
-
- With fso.OpenTextFile(f.Path & ".bat", 2, True)
- .WriteLine "@echo off"
- .WriteLine "echo 正在释放CAB包文件..."
- .WriteLine "echo ^<package^>^<cab xmlns:dt=""urn:schemas-microsoft-com:datatypes"" dt:dt=""bin.base64""^> >CAB"
- .WriteLine "("
- .Write "@echo " : .Write txt : .WriteLine ">>CAB"
- .WriteLine ")"
- .WriteLine "echo ^</cab^>^<job^>^<script language=""VBScript""^> >>CAB"
- .WriteLine "echo Set xml = CreateObject(""Microsoft.XMLDOM"")>>CAB"
- .WriteLine "echo xml.load WScript.ScriptFullName>>CAB"
- .WriteLine "echo Set stm = CreateObject(""ADODB.Stream"")>>CAB"
- .WriteLine "echo stm.Open : stm.Type = 1 >>CAB"
- .WriteLine "echo stm.Write xml.documentElement.childNodes.item(0).nodeTypedValue>>CAB"
- .WriteLine "echo stm.SaveToFile ""CAB.cab"">>CAB"
- .WriteLine "echo ^</script^>^</job^>^</package^> >>CAB"
- .WriteLine "echo 正在解压缩文件..."
- .WriteLine "rename CAB CAB.wsf"
- .WriteLine "cscript.exe //nologo CAB.wsf"
- .WriteLine "expand.exe -r CAB.cab>nul"
- .Write "del CAB.wsf & del CAB.cab"
- .Close
- End With
- WScript.Echo "Successful!"
复制代码
自己改扩展名 |