vbs中
复制代码 代码如下:
option explicit
on error resume next
sub include(vbs)
dim fso : set fso = createobject("scripting.filesystemobject")
dim p : p = split(wscript.scriptfullname,"")
p(ubound(p)) = vbs
p = join(p,"")
dim f : set f = fso.opentextfile(p)
execute f.readall()
' executeglobal f.readall()
f.close()
set f = nothing
set fso = nothing
' wscript.echo(p)
end sub
include("1.vbs")
include("2.vbs")
'if err then
' wscript.echo(err.description)
' wscript.quit()
'end if
wscript.echo(a+b)
1.vbs
a = 3
2.vbs
b = 4