简体   繁体   English

如何以递归方式编写`rar`sa文件夹及其所有内容的脚本?

[英]How to write script that `rar`s a folder and all its content recursively?

I currently have the following script: 我目前有以下脚本:

mkdir \\file-srv\Archive\Products\Web\AccountsServices\Account.Toolbar\Nightly\Accounts-4.2-TC-new\%system.build.number%
xcopy /I /E /Y %env.working_directory%\Deployment\Account\Release\*.* \\file-srv\Archive\Products\Web\AccountsServices\Account.Toolbar\Nightly\Accounts-4.2-TC-new\%system.build.number%

What script should I add to create a rar of that folder aside the 我应该添加什么脚本来创建该文件夹的rar

\\file-srv\\Archive\\Products\\Web\\AccountsServices\\Account.Toolbar\\Nightly\\Accounts-4.2-TC-new\\%system.build.number% \\文件-SRV \\存档\\产品\\网络\\ AccountsServices \\ Account.Toolbar \\每晚\\帐户-4.2-TC-新\\%system.build.number%

(same level) (同一级别)

I suppose you have WinRar installed so you can use its command line (and it's path is in the PATH environment variable otherwise you have to specify the full path). 我想你已经安装了WinRar,所以你可以使用它的命令行(它的路径在PATH环境变量中,否则你必须指定完整的路径)。

This will create a file named %system.build.number%.rar (with the right name :)) in the \\\\file-srv\\Archive\\Products\\Web\\AccountsServices\\Account.Toolbar\\Nightly\\Accounts-4.2-TC-new\\ folder with all files from %env.working_directory%\\Deployment\\Account\\Release\\*.* including all its sub-directories. 这将在\\\\file-srv\\Archive\\Products\\Web\\AccountsServices\\Account.Toolbar\\Nightly\\Accounts-4.2-TC-new\\创建名为%system.build.number%.rar (正确名称:)的\\\\file-srv\\Archive\\Products\\Web\\AccountsServices\\Account.Toolbar\\Nightly\\Accounts-4.2-TC-new\\文件夹,包含%env.working_directory%\\Deployment\\Account\\Release\\*.*所有文件,包括其所有子目录。

rar a -r -y \\file-srv\Archive\Products\Web\AccountsServices\Account.Toolbar\Nightly\Accounts-4.2-TC-new\%system.build.number%.rar %env.working_directory%\Deployment\Account\Release\*.*

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何从当前目录中删除文件夹及其所有内容? - How to remove a folder and all its content from the current directory? Powershell 脚本以递归方式删除每个文件夹中的文件,除了最近写入时间的 10 个文件夹 - Powershell Script to delete files recursively in every folder except 10 with the most recent write time 如何在目录树中递归地将所有文件和文件夹名称中的所有空格替换为下划线? - How to replace all spaces by underscores in all file and folder names recursively in a directory tree? 批处理文件以递归方式查找文件并将其rar - Batch file recursively find files and rar them 使用Shell脚本或bat脚本了解文件夹内文件夹的所有路径 - Know all path's to a folder inside folder using shell script or bat script 如何递归删除文件夹树的所有文件夹,除非它们包含具有特定文件扩展名的文件? - How to recursively delete all folders of a folder tree unless they contain a file with certain file extension? 如何为给定文件夹中的所有文件递归切换只读状态 - How to toggle Read-Only Status recursively for all files in a given folder 如何使用 Windows Bash 递归重命名所有文件和文件夹,包括文件名的特定部分? - How to recursively rename all files and folder including specific part of the filename with Windows Bash? 编写脚本以在批处理脚本中递归列出其中的目录和文件 - Write a script to recursively list directories and files within it in Batch script 使用批处理脚本递归重命名文件夹中的文件和子文件夹 - recursively rename files AND subfolders in a folder using batch script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM