[英]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.