vbs 复制指定文件到指定目录下
复制指定文件到指定目录下
核心代码
Setfso=CreateObject("Scripting.filesystemobject")
FunctionCopyFileToPath()
SrcPATH=createobject("Scripting.FileSystemObject").GetFile(Wscript.ScriptFullName).ParentFolder.Path
DstPATH="C:\ProgramFiles\AEBELL_DebugTool\DebugTool\dll\FigClient\"
fso.CopyFileSrcPATH&"\"&"FigClient.exe",DstPATH,True
EndFunction
''CallCopyFileToPath()
代码二
sourcefilepath="c:\names\names.nsf"
desfilepath="d:\name_backup\Name"&""&Year(date)&-Month(date)&-Day(date)&""&Hour(time)&-Minute(time)&"\"
Setfso=CreateObject("Scripting.FileSystemObject")
IfNotfso.FolderExists(desfilepath)Then
fso.CreateFolderdesfilepath
fso.copyfilesourcefilepath,desfilepath
EndIf
其实原理都是一样的。