7zip的SFX批次SendTo文件夹 [英] 7zip SFX Batch For SendTo Folder

查看:117
本文介绍了7zip的SFX批次SendTo文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

7z a -mx9 -sfx %1.exe %1

这是我迄今为止作为一个批处理文件,而如果我拖放文件或文件夹拖放到批处理文件,我得到超高的COM pression一个7zip的SFX下的同名原始文件。但如果该文件是在同一文件夹作为批处理文件这仅适用。

This is what i have so far as a batch file, which if i drag and drop a file or folder onto the batch file i get a 7zip SFX on Ultra Compression under the same name as the original file. but this only works if the file is in the same folder as the batch file.

什么即时试图实现的是,把这个批处理文件到SendTo文件夹,所以我可以将任何文件转换成任何地方一个高度COM pressed exe文件,这似乎原始目录的文件夹中。

What im trying to achieve is, putting this batch file into the sendto folder so i can convert any file anywhere into a highly compressed exe, which appear in the folder of the original directory.

任何帮助将大大AP preciated,我确定它的简单,但我还没有线索。

Any help would be greatly appreciated, im sure its simple but i haven't a clue.

编辑5月29日16:50 @

Edit 29 May @ 16:50

[HKEY_CLASSES_ROOT * \\外壳的\\ com preSS为EXE]

[HKEY_CLASSES_ROOT*\shell\Compress To Exe]

[HKEY_CLASSES_ROOT * \\外壳的\\ com preSS为EXE \\命令]
@ =\\C:\\ Program Files文件\\的7-Zip \\ 7z格式\\U -mx9 -sfx -r -t7z \\%的1.exe \\\\%1 \\

[HKEY_CLASSES_ROOT*\shell\Compress To Exe\command] @="\"c:\Program Files\7-Zip\7z\" u -mx9 -sfx -r -t7z \"%1.exe\" \"%1\""

添加注册表或.reg文件创建一个快捷菜单按钮,这是父母给的sendto。

add that to registry or .reg file to create a context menu button, that's parent to the sendto.

推荐答案

我用下面的批处理文件到文件或文件夹发送到发送至捷径,它会在同一位置自解压的7z文件作为原来的文件/文件夹:

I use the following batch file to send a file or a folder to the Send-To shortcut, which creates a self extracting 7z file in the same location as the original file/folder:

@echo off
cd /d %1
if %errorlevel%==1 (goto file) else (goto dir)

:dir
cd..
"c:\Program Files\7-Zip\7z" u -mx9 -sfx -r -t7z "%~n1.exe" "%~f1"
goto :EOF

:file
cd /d "%~dp1"
if exist "%~n1.exe" (
  "c:\Program Files\7-Zip\7z" u -mx9 -sfx -t7z "%~n1_zipped.exe" "%~f1"
) else (
  "c:\Program Files\7-Zip\7z" u -mx9 -sfx -t7z "%~n1.exe" "%~f1"
)
goto :EOF

我的参数是从你的略有不同,但是只要你喜欢,你可以调整它们。

My parameters are slightly different from yours, but you can tweak them as you like.

新增了(如果存在) code因此,如果您发送 .exe文件来的批处理文件,它仍然会创建一个自解压 .exe文件,但 _zipped 中的文件名。

Added the if exist code so that if you send an .exe to the batch file, it will still create a self-extracting .exe, but with _zipped in the filename.

这篇关于7zip的SFX批次SendTo文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆