|
lisyofun
初级用户
 
积分 87
发帖 61
注册 2008-9-18
状态 离线
|
『楼 主』:
关于用批处理来关联Winrar并解压
使用 LLM 解释/回答一下
请看如下:
这里guanlian.bat里的内容:
@echo off
assoc.rar=rarfile
ftype rarfile="%programfiles%\winrar\jieyarar.bat" "%1" "%*"
assoc.zip=zipfile
ftype zipfile="%programfiles%\winrar\jieyazip.bat" "%1" "%*"
@echo off
title 正在解压....
echo 正在解压,如果文件较大,可能需要一点时间.
"%programfiles%\winrar\rar" x -y "*.rar" E:\临时下载存档区 >nul 2>nul
exit
这是 jieyarar.bat 里的内容
@echo off
title 正在解压....
echo 正在解压,如果文件较大,可能需要一点时间.
"%programfiles%\winrar\rar" x -y "*.rar" E:\临时下载存档区 >nul 2>nul
exit
这是jieyazip.bat里的内容
@echo off
title 正在解压....
echo 正在解压,如果文件较大,可能需要一点时间.
"%programfiles%\winrar\winrar" x -y "*.zip" E:\临时下载存档区 >nul 2>nul
exit
我本来只想解压用户点击的那个文件的,但不知道怎么才能获取那个变量,试过%0和%1
都不行,所以只能用*.zip和*.rar替代.
现在的问题是每解压一个文件,它都会解压当前目录下所有的rar或zip文件.
请问怎么才能只解压当前点击的文件呢.
Please provide the content that needs to be translated. Currently, the provided content is mostly in Chinese with some batch script code. Please clarify the specific part that needs to be translated. If it's the entire content, then it is as follows:
Please see the following:
The content in guanlian.bat:
@echo off
assoc.rar=rarfile
ftype rarfile="%programfiles%\winrar\jieyarar.bat" "%1" "%*"
assoc.zip=zipfile
ftype zipfile="%programfiles%\winrar\jieyazip.bat" "%1" "%*"
@echo off
title 正在解压....
echo 正在解压,如果文件较大,可能需要一点时间.
"%programfiles%\winrar\rar" x -y "*.rar" E:\临时下载存档区 >nul 2>nul
exit
This is the content in jieyarar.bat
@echo off
title 正在解压....
echo 正在解压,如果文件较大,可能需要一点时间.
"%programfiles%\winrar\rar" x -y "*.rar" E:\临时下载存档区 >nul 2>nul
exit
This is the content in jieyazip.bat
@echo off
title 正在解压....
echo 正在解压,如果文件较大,可能需要一点时间.
"%programfiles%\winrar\winrar" x -y "*.zip" E:\临时下载存档区 >nul 2>nul
exit
I originally only wanted to decompress the file that the user clicked, but I don't know how to get that variable. I tried %0 and %1
Neither worked, so I had to use *.zip and *.rar instead.
Now the problem is that every time I decompress a file, it decompresses all RAR or ZIP files in the current directory.
How can I only decompress the currently clicked file?
|
|
2009-3-4 17:53 |
|
|
lisyofun
初级用户
 
积分 87
发帖 61
注册 2008-9-18
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
如果有什么软件或外部程序能让压缩文件解压到指定的目录也行.
If there are any software or external programs that can decompress compressed files to a specified directory, that would also work.
|
|
2009-3-5 18:38 |
|
|
yishanju
银牌会员
     [b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
意思是所有压缩文件全部只能解压到一个目录里?
Does it mean that all compressed files can only be extracted to one directory?
|

有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2009-3-6 02:28 |
|
|
yishanju
银牌会员
     [b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
WINRAR --设置--压缩--默认解压路径
WINRAR -- Settings -- Compression -- Default Extraction Path
|

有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2009-3-6 02:33 |
|
|
lisyofun
初级用户
 
积分 87
发帖 61
注册 2008-9-18
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
呵呵,我的意思是,一打开一个rar文件或zip文件,它就会自动解压到指定的目录,就和自解压文件一样.
Hehe, what I mean is that as soon as you open a rar file or zip file, it will automatically extract to the specified directory, just like a self-extracting file.
|
|
2009-3-6 09:21 |
|
|
yishanju
银牌会员
     [b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
-_-那就干脆做一个脚本自动把RAR.ZIP转成自解
-_-_- Then simply make a script to automatically convert RAR.ZIP to self-extracting.
|

有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2009-3-6 19:31 |
|
|
Hanyeguxing
银牌会员
     正在学习中的菜鸟...
积分 1039
发帖 897
注册 2009-3-1 来自 在地狱中仰望天堂
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by lisyofun at 2009-3-6 09:21:
呵呵,我的意思是,一打开一个rar文件或zip文件,它就会自动解压到指定的目录,就和自解压文件一样.
以使用winrar.exe解压为例。
首先,假设我们要压缩并解压的文件是123.dat,期待他的解压路径为D:\hanye\guxing。首先,我们依次创建这些文件夹,然后把123.bat文件复制到该目录,将其压缩为123.rar。重点的是压缩的选项目:添加压缩时,“常规”下选择rar压缩格式,“文件”下选择“存储绝对路径”或“存储包括盘符的完全路径”。然后删除D:\hanye文件夹及其子文件夹和所有里面的文件。
在解压命令时,如下使用:
winrar.exe x -y "123.rar"
这样运行后,该123.rar就会被强制解压到D:\hanye\guxing。解压时并创建这些目录。
顺便说一点废话,用上面的方法创建的压缩文件,在我们用winrar的GUI界面解压缩时,无论使用哪个,都会创建绝对路径的目录。例如,选择解压到当前文件夹,则会在当前文件夹内生成子目录D_\hanye\guxing
至于你在1楼中说的会解压所有文件,那是因为你使用了*.rar和*.zip。
Last edited by Hanyeguxing on 2009-3-7 at 00:02 ]
Originally posted by lisyofun at 2009-3-6 09:21:
Hehe, what I mean is that as soon as you open a rar file or a zip file, it will automatically extract to the specified directory, just like a self-extracting file.
Take using winrar.exe for extraction as an example.
First, suppose the file we want to compress and extract is 123.dat, and the expected extraction path is D:\hanye\guxing. First, we create these folders in sequence, then copy the 123.bat file to this directory, and compress it into 123.rar. The key is the compression options: when adding compression, select the rar compression format under "General", and under "Files" select "Store absolute path" or "Store full path including drive letter". Then delete the D:\hanye folder and its subfolders and all files inside.
When using the extraction command, use it as follows:
winrar.exe x -y "123.rar"
After running this, this 123.rar will be forcibly extracted to D:\hanye\guxing, and these directories will be created during extraction.
By the way, a few words of nonsense. For the compressed file created by the above method, when we use the GUI interface of winrar to extract, no matter which one we use, it will create a directory with an absolute path. For example, if you choose to extract to the current folder, a subdirectory D_\hanye\guxing will be generated inside the current folder.
As for what you said in floor 1 about extracting all files, that's because you used *.rar and *.zip.
Last edited by Hanyeguxing on 2009-3-7 at 00:02 ]
|
|
2009-3-6 23:34 |
|
|
Hanyeguxing
银牌会员
     正在学习中的菜鸟...
积分 1039
发帖 897
注册 2009-3-1 来自 在地狱中仰望天堂
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
不好意思,没看明白你在1楼的意思,你是不是要使在自己的机器里,双击任意.rar 或.zip,会将其强制解压缩到某个指定的目录?
Last edited by Hanyeguxing on 2009-3-7 at 00:05 ]
I'm sorry, I didn't understand what you meant in the first floor. Do you want to make it so that double-clicking any.rar or.zip in your own machine will force it to decompress to a specified directory?
Last edited by Hanyeguxing on 2009-3-7 at 00:05 ]
|
|
2009-3-6 23:44 |
|
|
lisyofun
初级用户
 
积分 87
发帖 61
注册 2008-9-18
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
对,我的意思是只要客人一点击rar或zip文件,它就会自己解压到E:\临时下载存档区 这个固定的文件夹,因为文件都是客人自己下载的,所以总不能让客人自己做自解压文件吧,就比如说,客人刚刚下载了一个1.rar的文件,他一打开就会自动解压到E:\临时下载存档区这个文件夹里。我现在的问题是客人如果下了两个rar以上的压缩文件,一点击的话两个都会自动解压到E:\临时下载存档区,我想让它单独解压,就和自解压文件一样。
还有如果不用*.rar或*.zip的话,根本解压不了。
Yes, what I mean is that as soon as the guest clicks on a rar or zip file, it will automatically extract to the fixed folder E:\Temporary Download Archive Area. Since the files are downloaded by the guest themselves, there's no way to make the guest create self-extracting archives by themselves. For example, if the guest just downloaded a 1.rar file, as soon as he opens it, it will automatically extract to the E:\Temporary Download Archive Area folder. Now my problem is that if the guest downloads two or more rar compressed files, as soon as he clicks, both will automatically extract to the E:\Temporary Download Archive Area, and I want it to extract separately, just like self-extracting archives. Also, if you don't use *.rar or *.zip, it simply can't be extracted.
|
|
2009-3-7 12:38 |
|
|
xswdong
中级用户
  
积分 216
发帖 129
注册 2007-2-14
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
有点强奸民意的意思,恐怕不妥。
It has a bit of the meaning of violating public opinion, and it's恐怕 not appropriate.
Wait, no, let's do it again. The correct translation should be: It has a bit of the meaning of going against public opinion, which I'm afraid is inappropriate.
|
|
2009-3-8 06:35 |
|
|
lisyofun
初级用户
 
积分 87
发帖 61
注册 2008-9-18
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
晕,我们这是网吧,当然有自己的考虑啊,现在讨论的是如何实现这一功能.
我现在加了一句 del /f "*.zip" 和 del /f "*.rar" 每次解压后都会删除原文件,虽然不太完美,但也还行.
Oh, we're in an internet cafe, of course we have our own considerations. Now we're discussing how to implement this function.
I added a line "del /f "*.zip" and del /f "*.rar" just now. Every time after decompression, the original files will be deleted. Although it's not perfect, it's still okay.
|
|
2009-3-8 19:12 |
|
|
yishanju
银牌会员
     [b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
rar命令本身就支持解压后删除源文件
The `rar` command itself supports deleting the source file after decompression
|

有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2009-3-11 16:28 |
|
|
lisyofun
初级用户
 
积分 87
发帖 61
注册 2008-9-18
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
不知道怎么样才能只解压用户点击的解压文件啊。
I don't know how to only extract the compressed file that the user clicks on.
|
|
2009-3-11 18:56 |
|
|
yishanju
银牌会员
     [b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
我有想法了
我懒得装虚拟机
你有没可以远程登陆的测试环境
I have an idea.
I'm too lazy to install a virtual machine.
Do you have a test environment that can be logged in remotely?
|

有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2009-3-12 20:49 |
|
|
yishanju
银牌会员
     [b]看你妹啊[/b]
积分 1488
发帖 1357
注册 2006-5-20
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
在文件夹选项-文件类型-rar 点高级,改成 "C:\Program Files\WinRAR\unrar.exe" x -o+ -y "%1" E:\临时下载存档区\
In Folder Options - File Types - RAR, click Advanced, and change it to "C:\Program Files\WinRAR\unrar.exe" x -o+ -y "%1" E:\Temporary Download Archive Area\
|

有问题请发论坛或者自行搜索,再短消息问我的统统是SB |
|
2009-3-12 21:57 |
|