国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > VBScript > 正文

把任意文件轉(zhuǎn)成vbs文件的file2vbs的vbs代碼

2020-07-26 11:58:43
字體:
供稿:網(wǎng)友

Tr4c3:為了方便在dos下使用,我把inputbox改成了args。

復(fù)制代碼 代碼如下:

'Program By xiaolu 
'name:file2vbs.vbs 
On error resume next 
Set Args = Wscript.Arguments 
If Args.length<>2 Then 
Wscript.Echo "Usage:" & Wscript.ScriptName & " c:/muma.exe c:/muma.vbs" 
Wscript.Quit 
End If 

do while 1 
fname = Args(0) 
Set Ado = CreateObject("adodb.stream") 
With Ado 
.Type = 1 
.open 
.loadfromfile fname 
ss = .read 
End With 
exit do 
Loop 

fname = Args(1) 
Set Fso=CreateObject("Scripting.FileSystemObject") 
Set File=fso.OpenTextFile(fname,2, True) 
lens=lenB(ss) mod 500 
For j=0 to int(lenB(ss)/500)-1 
if j=0 then 
File.writeline "ss="""&Bin2Str(midb(ss,500*j+1,500))&"""_" 
else 
File.writeline "+"""&Bin2Str(midb(ss,500*j+1,500))&"""_" 
end if 
next 
if lens>0 then 
File.writeline "+"""&Bin2Str(rightb(ss,lens))&"""" 
else 
File.writeline "+"&chr(34)&chr(34) 
end if 
File.writeline "" 
File.writeline "Set RS=CreateObject(""ADODB.Recordset""):L=Len(ss)/2:RS.Fields.Append ""m"",205,L:RS.Open:RS.AddNew:RS 
(""m"")=ss&ChrB(0):RS.Update:ss=RS(""m"").GetChunk(L)" 
File.writeline "Set s=CreateObject(""ADODB.Stream""):with s:.Mode = 3:.Type = 1:.Open():.Write ss:.SaveToFile  
wscript.arguments(0),2:end with" 
File.close 
Set fso=nothing 
Ado.close 
set Abo=nothing 
Function Bin2Str(Re) 
For i = 1 To lenB(Re) 
bt = AscB(MidB(Re, i, 1)) 
if bt < 16 Then Bin2Str=Bin2Str&"0" 
Bin2Str=Bin2Str & Hex(bt) 
Next 
End Function 

重新生成文件的辦法

cscript xx.vbs x:/xxxx.exe
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 奇台县| 尼勒克县| 芜湖市| 阿鲁科尔沁旗| 兴安县| 杭锦旗| 万全县| 上林县| 阿城市| 武陟县| 都江堰市| 宜兰市| 晋州市| 延边| 蒙城县| 灵山县| 绥芬河市| 白山市| 军事| 龙州县| 赞皇县| 安仁县| 财经| 盐山县| 安新县| 滨海县| 汉源县| 鄂温| 彝良县| 晴隆县| 类乌齐县| 武功县| 垫江县| 柳江县| 邢台县| 康乐县| 巴林右旗| 长葛市| 东平县| 慈利县| 太康县|