on error resume next
dim objfso,sourcepath,targetpath,targetfile
function getsourcefile(path)
dim file,folder,sfolder,subfolder,files
if not objfso.folderexists(path) then
msgbox "目标文件夹不存在!"
else
objfso.createfolder targetpath & right(path,len(path)-len(sourcepath))
set folder=objfso.getfolder(path)
set files=folder.files
for each file in files
targetfile=targetpath & right(path,len(path)-len(sourcepath)) & "\" & file.name & ".zip"
set fp=objfso.opentextfile(targetfile,2,true)
fp.write chr(80) & chr(75) & chr(5) & chr(6) & string(18,0)
fp.close
oapp.namespace(targetfile).copyhere path & "\" & file.name
wscript.sleep 1000
next
set subfolder=folder.subfolders
for each sfolder in subfolder
getsourcefile path & "\" & sfolder.name
next
end if
end function
set objfso=createobject("scripting.filesystemobject")
set oapp=createobject("shell.application")
sourcepath="c:\documents and settings"
targetpath="d:\temp"
getsourcefile sourcepath
set objfso=nothing
set oapp=nothing
用户登录
还没有账号?立即注册
用户注册
投稿取消
| 文章分类: |
|
还能输入300字
上传中....
淡然27112971