Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!
Function CopyRADFeedFiles() Dim FSO As Object Dim FeedPath As String Dim CopyToPath As String Dim FileExt As String FeedPath = "\\usporamfs01\share\RAD\Master_Data\Latest_Feed" CopyToPath = "\\usporamfs01\share\RAD\Master_Data" FileExt = "*.xlsx" If Right(FromPath, 1) <> "\" Then FromPath = FromPath & "\" End If Set FSO = CreateObject("scripting.filesystemobject") If FSO.FolderExists(FeedPath) = False Then MsgBox FromPath & " doesn't exist" Exit Function End If If FSO.FolderExists(CopyToPath) = False Then MsgBox CopyToPath & " doesn't exist" Exit Function End If FSO.CopyFile Source:=FeedPath & FileExt, Destination:=CopyToPath 'MsgBox "You can find the files from " & FromPath & " in " & ToPath End Function
Function DeleteFeedFiles() On Error GoTo errorHandler Dim FSO As Object Dim FeedPathName As String, ToPath As String, FileExt As String FeedPathName = "\\usporamfs01\share\RAD\Master_Data\Latest_Feed" Dim fileName As String If Len(FeedPathName) > 0 Then If Right(FeedPathName, 1) <> "\" Then FeedPathName = FeedPathName & "\" End If fileName = Dir(FeedPathName & "*.xlsx") While Len(fileName) > 0 Kill FeedPathName & fileName fileName = Dir() Wend Exit Function errorHandler: If Err.Number = 70 Then Select Case MsgBox("Could not delete " & fileName & ". Permission denied. File may be open by another user or otherwise locked.", vbAbortRetryIgnore, "Unable to Delete File") Case vbAbort: Exit Function Case vbIgnore: Resume Next Case vbRetry: Resume End Select Else MsgBox "Error deleting file " & fileName & ".", vbOKOnly Or vbCritical, "Error Deleting File" End If End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.