Batch copy and compress the implementation code of a file
Copy Code code as follows:
@echo on
REM assigns the source path to the SP
Set Sp=d:/javaworkspace/huayu_bbs
REM Gets the current date and calls the copy process
for/f "tokens=2 delims=="%%a in (' WMIC OS get localdatetime/value^|findstr/i ' LocalDateTime ') does (call:d oit%%a)
Pause
Exit
:d OIT
Set dt=%1
REM Gets the source path to the original folder name and date, and then copies (contains subfolders)
xcopy/i/e "%sp%" "f:/fanxin/%sp:~3%-%dt:~0,4%-%dt:~4,2%-%dt:~6,2%"
========== the above code means to copy all the files under D:/javaworkspace/huayu_bbs to the specified directory f:/fanxin, and then add a date to the back of the folder
CD C:/Program Files/winrar rar.exe a-r-s-ep1-m1 C:/finl/data.rar
========== This line of code means that all the files under c:/fanxin/are compressed into a compressed package known as Data.rar and stored in the c:/finl/directory.
@echo off
Batch copy files are copied to multiple RAR compressed packages to copy several files (jpg htm reg txt ico) files in the same directory to
All RAR format compression packages under the same letter
How to achieve it? Online wait ~ Thank you
Copy Code code as follows:
@echo off
Set Path=c:\program files\winrar\;%path%
FOR/R d:\%%i in (.) Do (
pushd%%i
For%%i in (*.rar) do rar a%%i d:\1.txt d:\2.txt d:\3.txt
)
The above d:\ for the partition you want to operate, D:\1.txt D:\2.txt D:\3.txt replaced by the file you want to add, save as a bat file