Related:
- Copy file vb.net
- Windows 10 iso file download 64-bit - Download - Windows
- Kmspico zip file download - Download - Other
- Tiny 11 iso file download - Download - Windows
- Dvi file - Guide
- Messenger file downloader - Guide
2 responses
Dear Simmi,
Below is a sample that can help you in undertaking the task:
Dim oFS : Set oFS = CreateObject( "Scripting.FileSystemObject" )
Dim sSrcDir : sSrcDir = "//server\share"
Dim sDstDir : sDstDir = oFS.GetAbsolutePathName( "your\folder" ) & "\"
WScript.Echo "sSrcDir:", sSrcDir
WScript.Echo "sDstDir:", sDstDir
If Not oFS.FolderExists( sDstDir ) Then oFS.CreateFolder sDstDir
Dim oSrcFiles : Set oSrcFiles = oFS.GetFolder( sSrcDir ).Files
Dim oFile, sFSpec
For Each oFile In oSrcFiles
WScript.Echo "Src ", oFile.Path
sFSpec = sDstDir & oFile.Name
If oFS.FileExists( sFSpec ) Then
WScript.Echo "Fnd ", sFSpec
If oFile.DateLastModified > oFS.GetFile( sFSpec ).DateLastModified Then
WScript.Echo "Cpy (D)", sFSpec
oFile.Copy sFSpec
End If
Else
WScript.Echo "Cpy (N)", sFSpec
oFile.Copy sFSpec
End If
Next
Thanks in advance.
Below is a sample that can help you in undertaking the task:
Dim oFS : Set oFS = CreateObject( "Scripting.FileSystemObject" )
Dim sSrcDir : sSrcDir = "//server\share"
Dim sDstDir : sDstDir = oFS.GetAbsolutePathName( "your\folder" ) & "\"
WScript.Echo "sSrcDir:", sSrcDir
WScript.Echo "sDstDir:", sDstDir
If Not oFS.FolderExists( sDstDir ) Then oFS.CreateFolder sDstDir
Dim oSrcFiles : Set oSrcFiles = oFS.GetFolder( sSrcDir ).Files
Dim oFile, sFSpec
For Each oFile In oSrcFiles
WScript.Echo "Src ", oFile.Path
sFSpec = sDstDir & oFile.Name
If oFS.FileExists( sFSpec ) Then
WScript.Echo "Fnd ", sFSpec
If oFile.DateLastModified > oFS.GetFile( sFSpec ).DateLastModified Then
WScript.Echo "Cpy (D)", sFSpec
oFile.Copy sFSpec
End If
Else
WScript.Echo "Cpy (N)", sFSpec
oFile.Copy sFSpec
End If
Next
Thanks in advance.
Mar 9, 2010 at 04:19 PM
Jan 25, 2012 at 03:16 PM