Welcome to KORG!
AppData itself isn't a redirected folder, but it does contain redirected folders, which can't be accessed. I rewrote this with the DirListUDF and it works fine because DirList enumerates the files and copies them one at a time. In my test, 5505 files were copied and 7 were skipped due to access restrictions or "file in use/locked" conditions. I test this on Windows 7 (x64) without any issue.
You'll need to download the DirList UDF from the UDF section here and change the Call statement to reference the path on your system (or eliminate the Call and embed the UDF in your script directly.
Glenn[code]$ = SetOption('WrapAtEOL', 'On')
$User = @USERID
$DAYNUMB=@YDAYNO MOD 10
$APPDATA = 'C:\Users\gbarnas\AppData\'
$TARGETapp = 'H:\Backup\Users\' + $User + '\' + $DAYNUMB + '\AppData\'
'Creating ' $TargetApp ' folder' ?
MD $TARGETapp
'Copying ' + $APPDATA ?
' to ' + $TARGETapp ?
; get array of files
$aDir = DirList($AppData, 5)
@SERROR ?
UBound($aDir) + 1 ' files to process' ?
Sleep 2
For Each $Dir in $aDir
$Dir ?
Copy $AppData + $Dir $TargetApp /h /r /c
If @ERROR
' ' @ERROR ' / ' @SERROR ?
' ##########' ?
$Err = $Err + 1
Sleep 2
EndIF
Next
$Err ' errors occurred' ?
UBound($aDir) + 1 - $Err ' files processed successfully' ?[code]
_________________________
Actually I
am a Rocket Scientist!