asked on
::
::
::
:: Source Directory :
::
/SD:\\ComputerName\c$\ :: Source Directory.
::
:: Destination Directory :
::
/DD:E:\Migrated Data\ccnllp\Username\ComputerName\Root\ByExtension\ :: Destination Directory.
::
:: Include These Files :
::
/IF :: Include Files matching these names
*.log
*.txt
*.acl
*.ade
*.asd
*.cnv
*.doc
*.dot
*.grv
*.h1q
*.iaf
*.maf
*.mam
*.maq
*.mar
*.mat
*.maw
*.mda
*.mdb
*.mde
*.mdt
*.mdw
*.mpd
*.mpp
*.mpt
*.mso
*.oab
*.obi
*.oft
*.olm
*.one
*.ops
*.ost
*.pip
*.pot
*.ppa
*.pps
*.ppt
*.prf
*.pst
*.pub
*.puz
*.slk
*.snp
*.svd
*.vdx
*.vsd
*.vss
*.vst
*.vsx
*.vtx
*.wbk
*.wll
*.xar
*.xla
*.xlb
*.xlc
*.xll
*.xlm
*.xls
*.xlt
*.xlw
*.xsf
*.xsn
*.dic
*.lex
*.nk2
*.pdf
*.rtf
*.thmx
*.ccda
*.ccdb
*.ccdb
*.ccdc
*.ccde
*.ccdp
*.ccdr
*.ccdt
*.ccdu
*.crtx
*.docm
*.docx
*.dotm
*.dotx
*.epkg
*.pa
*.pmsg
*.potm
*.potx
*.ppam
*.ppsm
*.ppsx
*.pptm
*.pptx
*.sldm
*.sldx
*.vsdx
*.xl
*.xlam
*.xlsb
*.xlsm
*.xlsx
*.xltm
*.xltx
*.xslb
*.db
*.dbf
*.ldb
*.mdb
*.sdf
*.sqlite
*.bmp
*.emf
*.gif
*.ico
*.jpg
*.png
*.tif
*.wmf
*.dat
*.kml
*.kmz
*.xml
*.wav
*.wmdb
*.wpl
*.cfg
*.config
*.icc
*.ini
*.properties
*.zip
*.msg
/XJD :: eXclude Junction points for Directories.
::
:: Exclude These Directories :
::
/XD :: eXclude Directories matching these names
temp
akamai
cache
unified_cache_leveldb_leveldb2
\\ComputerName\c$\Users\Username\WiredRed
\\ComputerName\c$\Users\Username\Videos
\\ComputerName\c$\Users\Username\Music
\\ComputerName\c$\Users\Username\Contacts
\\ComputerName\c$\Users\Username\Pictures
\\ComputerName\c$\Users\Username\Downloads
\\ComputerName\c$\Users\Username\Documents
\\ComputerName\c$\Users\Username\Desktop
\\ComputerName\c$\Users\Username\Appdata\Roaming\Zeon
\\ComputerName\c$\Users\Username\Appdata\Roaming\Litera
\\ComputerName\c$\Users\Username\Appdata\Local\Litera
\\ComputerName\c$\Users\Username\Appdata\Local\Interwoven\QuickSearch\Config
\\ComputerName\C$\dbmakerW64
\\ComputerName\C$\epop
\\ComputerName\C$\epopAdmin
\\ComputerName\C$\epopremove
\\ComputerName\C$\epopremove-verified
\\ComputerName\C$\ePopServer
\\ComputerName\C$\inetpub
\\ComputerName\C$\KB3AIK_EN
\\ComputerName\C$\Robocopy
\\ComputerName\C$\robocopy.bak
\\ComputerName\C$\Scripts
\\ComputerName\C$\StaffData
\\ComputerName\C$\treesize
\\ComputerName\C$\Visio
\\ComputerName\C$\WiredRed
content.ie*
::
:: Exclude These Files :
::
/XF :: eXclude Files matching these names
*.tmp
*cache*
*akamai*
*.lock
::
:: Copy options :
::
/S :: copy Subdirectories, but not empty ones.
/PF :: check run hours on a Per File (not per pass) basis.
/COPY:DAT :: what to COPY for files (default is /COPY:DAT).
/ZB :: use restartable mode; if access denied use Backup mode.
/EFSRAW :: copy all encrypted files in EFS RAW mode.
::
:: Retry Options :
::
/R:1 :: number of Retries on failed copies: default 1 million.
/W:10 :: Wait time between retries: default is 30 seconds.
::
:: Logging Options :
::
/V :: produce Verbose output, showing skipped files.
/X :: report all eXtra files, not just those selected.
/TS :: include source file Time Stamps in the output.
/FP :: include Full Pathname of files in the output.
/NP :: No Progress - don't display percentage copied.
/LOG+:C:\Robocopy\Username_ComputerName_YYYYMMDD_HHMMSS.log :: output status to LOG file (append to existing log).
'Sub to recursively delete all empty folders.
Sub RecursiveDeleteEmptyFolders(ByVal strDirectory)
On Error Resume Next
Dim objFolder, objSubFolder
Set objFolder = objFSO.GetFolder(strDirectory)
WScript.Echo "Checking Folder: " & strDirectory & ". Contains " & objFolder.Files.Count & " files and " & objFolder.SubFolders.Count & " folders."
'If the RemoveDesktopIni or RemoveThumbsDB Flag is set to True then remove any files called Desktop.ini or thumbs.db
If objFSO.FileExists(strDirectory & "\desktop.ini") Then
objFSO.DeleteFile(strDirectory & "\desktop.ini")
If Err Then
WScript.Echo "Error deleting:" & strDirectory & "\desktop.ini" & " - " & Err.Description
intErrorCount = intErrorCount + 1
Err.Clear
End If
End If
If objFSO.FileExists(strDirectory & "\thumbs.db") Then
objFSO.DeleteFile(strDirectory & "\thumbs.db")
If Err Then
WScript.Echo "Error deleting:" & strDirectory & "\thumbs.db" & " - " & Err.Description
intErrorCount = intErrorCount + 1
Err.Clear
End If
End If
'Check if there are any subfolders, and if so go through each of those recursively deleting them
If objFolder.SubFolders.Count > 0 Then
For Each objSubFolder in objFolder.SubFolders
RecursiveDeleteEmptyFolders objSubFolder.Path
Next
End If
'Now check if the folder contains any files.
If objFolder.Files.Count = 0 And objFolder.SubFolders.Count = 0 Then
'Check that the folder name does not begin with a tildeand if it does not then delete it
If Left(objFolder.Name,1) <> "~" Then
WScript.Echo "Deleting: " & objFolder.Path
objFolder.Delete
If Err Then
WScript.Echo "Error deleting:" & objFolder.Name & " – " & Err.Description
intErrorCount = intErrorCount + 1
Err.Clear
End If
End If
End If
End Sub