Move Files with a .bat

luno -  
crapoulou Posted messages 28002 Registration date   Status Modérateur, Contributeur sécurité Last intervention   -
Hello,

I would like to move older .csv files from one directory to another using a .bat file to be scheduled.

Thank you for your help.

1 réponse

crapoulou Posted messages 28002 Registration date   Status Modérateur, Contributeur sécurité Last intervention   8 046
 
Hello,

First, you need to create a .bat file that performs the movement of these files.

To do this, the MOVE command can be used.

Example:
echo off
for %%A in (C:\Folder1\*.csv) do move %%A C:\Folder1\backup >nul
echo on


Create a .bat file stored on the PC (and whose path will not change).

Then, you will need to create a scheduled task to schedule the automatic execution of the .bat file:
https://jpcheck.developpez.com/tutoriels/windows/creer-tache-planifiee-sous-windows-7/
3