简单地融为一体preSS批量用WinRAR命令行1文件夹? [英] Simply compress 1 folder in batch with WinRAR command line?

查看:148
本文介绍了简单地融为一体preSS批量用WinRAR命令行1文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用WinRAR的命令行(C:\\ Program Files文件\\ WinRAR的\\ RAR.EXE),所有我想要做的是COM preSS单文件夹(C:\\用户\\%USERNAME%\\桌面\\ someFolder),并可能改变创建的.zip文件的名称。我试过只是RAR.EXE一个 C:\\用户\\%USERNAME%\\桌面\\ someFile 和它的作品,但它融为一体presses另一个文件夹(不是我放)。

Using the WinRAR command line (C:\Program Files\WinRAR\rar.exe), all I'm trying to do is compress a single folder (C:\Users\%username%\desktop\someFolder) and possibly change the name of the .zip file created. I've tried just "rar.exe a "C:\Users\%username%\desktop\someFile" and it works, but it compresses another folder (not the one I put).

我是什么做错了吗?

你能不能还提供解释(也许告诉我,是因为我不熟悉它是什么递归)?

Can you also provide explanation (and maybe tell me what recursion is because I'm unfamiliar with it)?

感谢

推荐答案

使用任何

"C:\Program Files\WinRAR\rar.exe" a -ep1 -r "Name of ZIP file with path" "C:\Users\%username%\desktop\someFolder"

创建一个ZIP文件与命令后指定名称 A (存档)和开关 -ep1 (排除名称基本目录)和 -r (递归),或使用

to create a ZIP file with the specified name after command a (archive) and the switches -ep1 (exclude base directory from names) and -r (recursive), or use

"C:\Program Files\WinRAR\rar.exe" a -ep1 -r "Name of ZIP file with path" "C:\Users\%username%\desktop\someFolder\"

文件夹 someFolder 包含在一个命令行的归档,而不在末尾的反斜线

文件夹 someFolder 不包括在归档文件,只是将文件与此文件夹的子目录,与第二个命令行 与结束反斜杠

在换句话说选项 -ep1 导致在添加文件或文件夹这也解释了存档中指定的文件或文件夹名称省略一切从路径到最后一个反斜杠在命令行上添加一个文件夹或不月底反弹的差异说明。

In other words option -ep1 results in omitting everything from path up to last backslash in specified file or folder name on adding the file or folder to the archive which explains the difference on adding a folder with or without backlash at end specified on command line.

递归意味着增加在所有子文件夹不仅在指定的文件夹中的文件,而且所有子文件夹下的所有文件

Recursion means to add not only the files in the specified folder, but also all subfolders and all files in all subfolders.

所以RAR必须在子文件夹中指定的文件夹优先搜索。如果找到进入这个子文件夹和子文件夹重新搜索。如果找到一个,进入这个子文件夹和搜索子文件夹。如果没有人发现,添加文件中的子文件夹到存档或者只是文件夹名称,如果子文件夹为空。然后回到父文件夹,并继续寻找下一子文件夹。如果没有找到,添加此子文件夹的文件。然后回到父文件夹,并继续搜索子文件夹,等等。

So RAR must search first in the specified folder for a subfolder. If found go into this subfolder and search again for a subfolder. If one is found, go into this subfolder and search for a subfolder. If no one found, add the files in this subfolder into the archive or just the folder name if the subfolder is empty. Then go back to parent folder and continue searching for next subfolder. If none is found, add the files of this subfolder. Then go back to parent folder and continue search for subfolder, and so on.

正如您可以阅读,同样的过程一遍又一遍整个文件夹树的每个分支,直到所有子文件夹都处理完成。这是通过使用一个递归实现。子程序搜索子文件夹自称每一个子文件夹中发现的时间。

As you can read, the same process is done again and again for each branch of the entire folder tree until all subfolders are processed. This is done using a recursion. The subroutine searching for subfolders calls itself every time a subfolder is found.

这篇关于简单地融为一体preSS批量用WinRAR命令行1文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆