中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-04 20:37
48,038 topics / 350,123 posts / today 0 new / 48,251 members
DOS批处理 & 脚本技术(批处理室) » Please tell me how to use the RAR command to compress files of specified types?
Printable Version  1,813 / 13
Floor1 bob1989 Posted 2007-05-14 13:51
中级用户 Posts 144 Credits 322
How to use the command to compress all *.TXT and *.LOG files under c:\windows with RAR?

I saw that the usage of RAR seems not to have this function~

Does it have to write these files to a file first and then compress with RAR?

May I ask what should I do?
Floor2 bob1989 Posted 2007-05-14 14:13
中级用户 Posts 144 Credits 322
Does anyone know? I'm really urgent!
Floor3 lxmxn Posted 2007-05-14 15:13
版主 Posts 4,938 Credits 11,386
```
rar a temfile.rar C:\windows\*.txt C:\windows\*.log
```
Floor4 bob1989 Posted 2007-05-17 12:41
中级用户 Posts 144 Credits 322
Floor5 bob1989 Posted 2007-05-25 12:29
中级用户 Posts 144 Credits 322
Prompt me, no file啊
Floor6 oilio Posted 2007-05-25 13:20
高级用户 Posts 303 Credits 641
If it doesn't succeed, it means there is no such file in the Windows directory. If the original poster means that all *.txt and *.log in the Windows directory including its subdirectories still need to use the for command to do it. Or use the command to search first, direct to the list file, and use the list file to do it.
Floor7 bob1989 Posted 2007-05-25 16:49
中级用户 Posts 144 Credits 322
"C:\WINDOWS" means including files in subdirectories, and there may be files with the same name. For example, C:\WINDOWS\a\a.txt and C:\WINDOWS\b\a.txt. Will it overwrite the original files when packaging?
Floor8 oilio Posted 2007-05-27 14:27
高级用户 Posts 303 Credits 641
dir/s/b/a-d %windir%\*.txt>list.txt
dir/s/b/a-d %windir%\*.log>>list.txt
rar a a @list.txt
Take a look inside a.rar, and it will contain all .txt and .log files in the Windows directory.
Floor9 yjq635 Posted 2007-05-28 10:46
初级用户 Posts 42 Credits 109
Floor10 nbic Posted 2007-05-28 11:19
初级用户 Posts 61 Credits 135
What you said upstairs is very comprehensive. It's more detailed than what I collected. Hehe. Collect it again.
Floor11 bob1989 Posted 2007-05-29 17:51
中级用户 Posts 144 Credits 322
I've been running naked for a few years.
Hehe``

Thanks for the guidance from yjq635.
I'll change my username and give you more points later.
Floor12 lxmxn Posted 2007-05-29 17:56
版主 Posts 4,938 Credits 11,386
The explanation on floor 9 is in the Rar.txt file in the WinRar installation folder.
Floor13 yh6688 Posted 2007-06-01 14:09
初级用户 Posts 12 Credits 20
"C:\Program Files\WinRAR\WinRAR.exe" a -ep2 -ibck -agyyyymmdd d:\qsbak\qssj.rar @d:\qsbak\qsback.lst

The location and file name after compression: d:\qsbak\qssj.rar
Create a text file: qsback.lst, which contains the list of files to be compressed
Z:\dbf\*.zip
Z:\dbf\zqjsxx.*
Z:\dbf\sh.dbf
Floor14 yh6688 Posted 2007-06-01 14:12
初级用户 Posts 12 Credits 20
The location and file name after compression: d:\qsbak\qssjyyyymmdd.rar, for example, qssj20070531.rar
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023