看一看,试一试
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
精华I
查看 112,744 回复 364
'''''''''''''''''''''''''''''''''''
'' (P)2008 Jv Ching (qinchun36) ''
'' Powed by 中国DOS联盟 ''
'' http://www.cn-dos.net/forum/ ''
'''''''''''''''''''''''''''''''''''
on error resume next
if Wscript.Arguments(0)="" then
msgbox "用鼠标把目标文件拖到我上面来!!!",16,"使用方法"
else
dim origfile,tmpstr,ching,fso,orig,fname,fpath
origfile=Wscript.Arguments(0)
Set fso=CreateObject("Scripting.FileSystemObject")
set ching=wscript.createobject("wscript.shell")
set tmpstr=fso.getfile(origfile)
fpath=tmpstr.parentfolder&"\"
fname="new_"&tmpstr.name '定义加密后的文件名为 new_原文件 ,你可以改成其他。
'如果已经存在 new_原文件 ,则删除之。
if (fso.fileexists(fpath&fname)) then
Set tmpstr=fso.getfile(fpath&fname)
tmpstr.Delete
end if
'创建 UNICODE 编码的文件头。在WINDOWS中用记事本打开会看到只有这些不是乱码。
Set tmpstr=fso.CreateTextFile(fpath&"unihead.txt",1,-1)
tmpstr.WriteLine "草,看他吗毛啊,老子都被qinchun36搞成乱码了!" '你可以在前面的双引号里任意写东西
tmpstr.close
'在被转换的文件头部加上两个空行和CLS清屏语句
Set tmpstr=fso.CreateTextFile(fpath&"bathead.txt",1)
tmpstr.writeBlankLines 2
tmpstr.writeline("cls") '清除开始时的错误信息,你也可以去掉这一行。
tmpstr.close
'为了简便,调用 CMD 命令合并文件并删除过度文件
tmpstr="cmd /c copy /b "&chr(34)&fpath&"unihead.txt"&chr(34)&"+"&chr(34)&fpath&"bathead.txt"&chr(34)&"+"&chr(34)&origfile&chr(34)&" "&chr(34)&fpath&fname&chr(34)&chr(38)&"del "&chr(34)&fpath&"unihead.txt"&chr(34)&chr(38)&"del "&chr(34)&fpath&"bathead.txt"&chr(34)
ching.run tmpstr,0
msgbox "加密后的文件是:"&chr(13)&chr(13)&fpath&fname,64,"Mr. Ching 提示你"
end if