当前位置: 移动技术网 > IT编程>脚本编程>VBScript > vbs 复制指定文件到指定目录下

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

2020年03月09日  | 移动技术网IT编程  | 我要评论

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

核心代码

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

其实原理都是一样的。

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网