ajtsystems
IS-IT--Management
Hi I have a sub which copies files using shell.application and copyhere. It's working however I would like to get some error logging going for any files which dont copy. I've looked through the MSDN pages but there is nothing obvious so I have added my own but it doesnt work
sub backup (arrmem, backupdir)
Err.Clear
set objShell = CreateObject("shell.application")
set Shellfolder = objShell.NameSpace(backupdir)
shellfolder.CopyHere (arrmem), 272
if Err.Number <> 0 then
' An exception occurred
wscript.echo "Exception:" & vbCrLf &_
" Error number: " & Err.Number & vbCrLf &_
" Error description: '" & Err.Description & vbCrLf
end if
wscript.echo now & arrmem & backupdir
end sub
Is there any any way I can for each file\folder copy verify that it has been copied - can I run a checksum check?
sub backup (arrmem, backupdir)
Err.Clear
set objShell = CreateObject("shell.application")
set Shellfolder = objShell.NameSpace(backupdir)
shellfolder.CopyHere (arrmem), 272
if Err.Number <> 0 then
' An exception occurred
wscript.echo "Exception:" & vbCrLf &_
" Error number: " & Err.Number & vbCrLf &_
" Error description: '" & Err.Description & vbCrLf
end if
wscript.echo now & arrmem & backupdir
end sub
Is there any any way I can for each file\folder copy verify that it has been copied - can I run a checksum check?