如何将压缩文件添加到右键菜单
- 编程技术
- 2025-02-06 21:15:47
- 1
Windows1. 打开注册表编辑器: 按下 `Win + R` 打开运行对话框。 输入 `regedit` 并按回车。2. 导航到以下路径: ``` HKEY_CLA...
Windows
1. 打开注册表编辑器:
按下 `Win + R` 打开运行对话框。
输入 `regedit` 并按回车。
2. 导航到以下路径:
```
HKEY_CLASSES_ROOTshell
```
如果这个路径下没有名为 `Compress` 的项,请创建一个。
3. 创建 `Compress` 项:
右键点击 `shell`,选择 `新建` -> `项`。
命名为 `Compress`。
4. 创建 `Command` 子项:
在 `Compress` 项下,右键点击空白处,选择 `新建` -> `项`。
命名为 `Command`。
5. 设置 `Command` 的默认值:
右键点击 `Command`,选择 `修改`。
在 `数值数据` 中输入以下命令,并根据您的压缩软件修改路径:
```
"C:Program Files7-Zip7z.exe" x "%1" -o"%L"
```
请确保将 `C:Program Files7-Zip7z.exe` 替换为您压缩软件的实际路径。
macOS
1. 打开终端。
2. 创建一个名为 `compress` 的AppleScript:
输入以下命令并按回车:
```bash
open -e /Applications/Utilities/Script Editor.app
```
在打开的脚本编辑器中,粘贴以下代码:
```applescript
tell application "Finder"
set the selection to (get selection)
if (count of the selection) > 0 then
set the file to item 1 of the selection
do shell script "tar -czf "" & quoted form of POSIX path of (path to temporary items from user domain) & "temp.tar.gz" " & quoted form of POSIX path of file
display dialog "Compressed file created at " & quoted form of POSIX path of (path to temporary items from user domain) & "temp.tar.gz"
end if
end tell
```
保存脚本为 `compress.scpt`。
3. 创建一个右键菜单项:
打开Finder。
按下 `Cmd + Shift + G` 打开“前往文件夹”对话框。
输入以下路径并按回车:
```
/System/Library/CoreServices/Finder.app/Contents/Resources/English.lproj/
```
找到名为 `Finder` 的文件,右键点击它,选择 `显示包内容`。
在打开的文件夹中,找到名为 `Menu Extras` 的文件夹。
在 `Menu Extras` 文件夹中,创建一个新的文件夹,命名为 `CompressMenu`。
在 `CompressMenu` 文件夹中,创建一个新的 `.menu` 文件,命名为 `Compress.menu`。
在 `Compress.menu` 文件中,粘贴以下内容:
```xml
```
请确保将 `/path/to/your/script.scpt` 替换为您脚本的实际路径。
4. 重启Finder:
关闭Finder。
打开终端,输入以下命令并按回车:
```bash
killall Finder
```
现在,在Windows上,您应该能够在压缩文件上右键点击并选择“Compress”来压缩它。在macOS上,您应该能够在压缩文件上右键点击并选择“Compress”来压缩它。
本文链接:http://xinin56.com/bian/494290.html
上一篇:为何手机重置不了,
下一篇:高中政史地要背多少知识点