复制指定文件到指定目录下
核心代码
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
其实原理都是一样的。
发表评论