Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Batch file 使用批处理文件提取.rar文件_Batch File - Fatal编程技术网

Batch file 使用批处理文件提取.rar文件

Batch file 使用批处理文件提取.rar文件,batch-file,Batch File,我正在尝试创建一个批处理文件,该文件使用WinRAR提取.rar文件 到C:\Program文件\ 请帮忙 我尝试了以下代码 set rar=%ProgramFiles%\WinRAR\RAR.exe set unrar=%programFiles%\WinRAR\UnRAR.exe 然后像这样压缩: "%rar%" a "drop location" "target location" %unrar% e "target location" 或者像这样解压: "%rar%" a "dr

我正在尝试创建一个批处理文件,该文件使用WinRAR提取.rar文件 到C:\Program文件\

请帮忙

我尝试了以下代码

set rar=%ProgramFiles%\WinRAR\RAR.exe

set unrar=%programFiles%\WinRAR\UnRAR.exe
然后像这样压缩:

"%rar%" a "drop location" "target location"
%unrar% e "target location"
或者像这样解压:

"%rar%" a "drop location" "target location"
%unrar% e "target location"
但我似乎没有看到一个选项显示目标rar文件的位置。请帮助我。

检查此页面:

基本上(取自该站点):

rar a-r yourfiles.rar*.txt c:\yourfolder
压缩某些内容

unrar x c:\yourfile.rar*.gif c:\extractfolder\
解压某些内容

*.txt和*.gif用于过滤文件类型,可以省略


页面底部还有两个示例批处理文件的链接。

非常感谢Rocks25:DNo问题:)您介意将我的答案标记为正确吗?