当前位置: 代码网 > it编程>前端脚本>其它脚本 > vbs 复制指定文件到指定目录下

vbs 复制指定文件到指定目录下

2024年05月18日 其它脚本 我要评论
复制指定文件到指定目录下核心代码set fso=createobject("scripting.filesystemobject")function copyfiletopath()srcpath =

复制指定文件到指定目录下

核心代码

set fso=createobject("scripting.filesystemobject")
function copyfiletopath()
srcpath = createobject("scripting.filesystemobject").getfile(wscript.scriptfullname).parentfolder.path
dstpath = "c:\program files\aebell_debugtool\debugtool\dll\figclient\"
fso.copyfile srcpath&"\"&"figclient.exe",dstpath,true
end function

' 'call copyfiletopath()

代码二

sourcefilepath="c:\names\names.nsf"
desfilepath="d:\name_backup\name"&""&year(date)&-month(date)&-day(date)&" "&hour(time)&-minute(time)&"\"
set fso=createobject("scripting.filesystemobject")
if not fso.folderexists(desfilepath) then
fso.createfolder desfilepath
fso.copyfile sourcefilepath,desfilepath
end if

其实原理都是一样的。

(0)

相关文章:

版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。

发表评论

验证码:
Copyright © 2017-2025  代码网 保留所有权利. 粤ICP备2024248653号
站长QQ:2386932994 | 联系邮箱:2386932994@qq.com