Trying to move edi backup files that start with "@" symbol from one
server to another server same domain: See code
Option Explicit
Dim fso
Dim objFolderSource
Dim objFolderDestination
Dim colFiles
Dim objFile
Dim strSourceDir
Dim strDestinationDir
Dim ArchiveDate
Dim starttime
strSourceDir = "\\server1\c$\q32w"
strDestinationDir = "\\server2\d$\QualediBackup"
starttime = now()
ArchiveDate = dateadd("m",-2,Now())
'Copy files from source to destination
Set fso = CreateObject("Scripting.FileSystemObject")
Set objFolderSource = fso.GetFolder(strSourceDir)
Set colFiles = objFolderSource.Files
For each objFile in colFiles
'msgbox objFile.Name & " - " & objFile.DateLastModified
If Left(objFile.name, 1) = "@" Then
objFile.Copy (strDestinationDir)
End If
Next
'clean up
set fso = nothing
set objFolderSource = nothing
set objFolderDestination = nothing
When script runs I get a Permission denied error. Any ideas? Is my code
wrong?