原文链接:https://gallery.technet.microsoft.com/scriptcenter/16439c02-3296-4ec8-9134-6eb6fb599880
使用方法:先将下面代码存为VBS脚本,然后拖拽需要加密的VBS脚本到此脚本,即可完成加密。
Option Explicit dim oEncoder, oFilesToEncode, file, sDest dim sFileOut, oFile, oEncFile, oFSO, i dim oStream, sSourceFile set oFilesToEncode = WScript.Arguments set oEncoder = CreateObject("Scripting.Encoder") For i = 0 to oFilesToEncode.Count - 1 set oFSO = CreateObject("Scripting.FileSystemObject") file = oFilesToEncode(i) set oFile = oFSO.GetFile(file) Set oStream = oFile.OpenAsTextStream(1) sSourceFile=oStream.ReadAll oStream.Close sDest = oEncoder.EncodeScriptFile(".vbs",sSourceFile,0,"") sFileOut = Left(file, Len(file) - 3) & "vbe" Set oEncFile = oFSO.CreateTextFile(sFileOut) oEncFile.Write sDest oEncFile.Close Next
时间: 2024-10-12 05:33:33