Home > OS >  Bulk copy of the same file name automatically rename files to a folder
Bulk copy of the same file name automatically rename files to a folder

Time:10-11

There are 36 files, each file has A folder inside, each A folder below r24 -p folder, now I want to get 36 r24 -p file to A folder that how to deal with,

CodePudding user response:

CD X: \ Backup

Set the date: dd=% % ~ 8, 2
The set date: mm=% %
~ 5, 2Set yy=% date: ~ 0, 4 %
Time: set the Tss=% % ~ 6, 2
Time: set Tmm=% %
~ 3, 2The set time: Thh=% % ~ 0, 2
If/I % Thh % LSS 10 (set Thh=0% time: ~ % 1, 1)

The set FName=% % % % % yy mm dd Tss Tmm Thh % % % % % % %

Xcopy/C/Y D: \ \ r24 - p A \ * extension X: \ Backup \
Ren X: \ Backup \ * extension % % FName. The extension

Forfiles/p C: \ Windows \ System32 \ the Tasks/m * * - d - 2/C "del CMD/C/f @ path"

Forfiles/p C: \ Windows \ the Tasks/m * job - d - 2/C "del CMD/C/f @ path"

Forfiles/p X: \ Backup/m * 7/c extensions - d - "del CMD/c/f @ path"
: : duplicate backup designated directory of the specified file, to the specified directory, and with the current system time renaming; Delete the specified number of days before the backup file - forfiles applies to Windows 7 system,

Pause

Save as bat batch file, run the

Role, you will automatically D: \ \ r24 - p A \ * extension file, copied to the X: \ Backup \ folder, and with the current system time renaming, may be useful, can also according to need to modify the

  • Related