用户登录
用户注册

分享至

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

  • 作者: kzh小柯
  • 来源: 51数据库
  • 2021-07-28

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

核心代码

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

其实原理都是一样的。

软件
前端设计
程序设计
Java相关