Batch Scrip move yesterday file from Frederik Long.

Y

yuttanaj

Hello Frederik Long

I'm trying to run your batch scrip on windows XP but I got an error per below imaged. Another windows 7 or windows 10 this scrip is working as well.

How can I using this batch scrip on XP??


3ff07262-34a0-4d72-a6bb-cd6ed9c0f43e?upload=true.jpg

@echo off
set Source=D:\My Temp Folder
set Target=M:\My Target Folder

set Scr="%temp%\TempVBS.vbs"
( echo sPath = "%Source%"
echo Set oFSO = CreateObject("Scripting.Filesystemobject"^)
echo sYesterday = FormatDateTime(DateAdd("d", Now(^), -1^),2^)
echo Process sPath
echo Sub Process(sP^)
echo For Each oFile In oFSO.GetFolder(sp^).Files
echo If FormatDateTime(oFile.DateLastModified,2^) = sYesterday _
echo Then oFile.Attributes = 32 _
echo Else oFile.Attributes = 0
echo Next
echo For Each oFolder In oFSO.GetFolder(sP^).SubFolders
echo Process oFolder.Path
echo Next
echo End Sub ) > %Scr%
cscript //nologo %Scr%
del %Scr%
robocopy /a /s /mov "%Source%" "%Target%"


Continue reading...
 
Back
Top Bottom