如何从命令行提取自解压exe
有没有办法从 Windows 命令行中提取自解压 exe?
我有一个 RAR 类型的自解压 exe。我只想在 Windows 的帮助下提取该 RAR 的内容,而不使用任何其他有助于提取的工具(如 7zip、Unrar 等)。另外,我只想从命令行执行此操作。
Windows 中是否有任何实用程序可用于从命令行提取自解压 exe 文件?
Is there a way to extract a self extracting exe from commandline in windows?
I have a self extracting exe which is of type RAR. I want to extract the contents of this RAR only with the help of windows and not using any other tools (like 7zip, Unrar etc) which helps to extract. Also, I want to do it from the command line only.
Are there any utilities in windows which I can use to extract the self extracting exe file from commandline?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用以下一个或多个 RAR SFX(自解压存档)选项来获取自解压 RAR 存档来执行您想要的操作:
我不确定这些选项中的任何一个是否会抑制运行 SFX 配置运行的安装程序。
You might be able to get the self-extacting RAR archive to do what you want with one or more of the following RAR SFX (self-extracting archive) options:
I'm not sure if any of these options will suppress running a setup program that the SFX is configured to run.
从此链接下载 Windows 版 UnRar(免费软件)。它本身是一个自解压存档,安装后将为您提供实际的 unrar.exe。然后,您可以使用 unrar.exe 从命令行提取文件。
Download UnRar for windows (freeware) from this link. It in itself is a self extracting archive, which when installed will give you the actual unrar.exe. You can then use unrar.exe to extract files from the command line.
使用 http://www.info-zip.org/ 中的解压缩实用程序。它是开源的,二进制文件适用于所有操作系统。
解压缩命令:
unzip.exe example.zip -d extract_folder
下载最新的 Windows 可执行文件 ftp://ftp.info-zip.org/pub/infozip/win32/。
下载“unz552xn-x64.exe”等二进制文件后,在命令行中运行它,它将给出一组文件,包括unzip.exe。由于 unzip.exe 没有任何依赖项,因此可以删除其他文件。
Use unzip utility from http://www.info-zip.org/. It is an open source and binaries are available for all os flavors.
unzip command:
unzip.exe sample.zip -d extract_folder
Download latest windows executable at ftp://ftp.info-zip.org/pub/infozip/win32/.
After downloading the binary like 'unz552xn-x64.exe', run it in command line, it will give a set of files including unzip.exe. since unzip.exe does not have any dependency other files can be deleted.
对于正在寻找此问题答案的其他人。
下载试用版或购买 WinRAR。右键单击要打包的文件,然后选择添加到存档。
在“常规”选项卡上选中“创建 sfx 存档”,这将为您提供 file.exe
在“高级”选项卡上选择“sfx 选项”,在“模式”选项卡下选择“全部隐藏”。
如果您不希望在程序/脚本运行后显示或保留提取的文件,请在同一选项卡下“解压到临时文件夹”。
在“提取后运行”的“设置”选项卡下,放置您要运行的程序或脚本。
文件打包后,您将拥有一个名为 file.exe 的文件。 (注意:文件将是您命名的 sfx 存档)。从命令行输入 file.exe,它将解压到临时位置(如果您选择了该位置)并运行您指定的程序/脚本。程序/脚本关闭后,临时位置中的文件夹将被删除。
注意:
如果从 WinPe CD 或其他类似的可启动媒体运行,请勿使用“解压到临时文件夹”。
WinRAR 只需要在制作 sfx 存档的计算机上即可。制作 sfx 存档后,您将不需要它来提取文件。
For others that are looking for the answer to this.
Download the trial version or purchase WinRAR. Right click the files you want to package and select add to archive.
Check "create sfx archive" on the General tab, this will give you the file.exe
Select the "sfx options" on the Advanced tab, under the Modes tab select "hide all".
If you don't want the extracted files to show or stay after your program/script has run then "Unpack to temporary folder" under this same tab.
Under the Setup tab in the "run after extraction" put the program or script you would like to run.
Once file(s) have been packaged you will have a file called file.exe. (Note:File will be what you named the sfx archive). From command line type file.exe and it will extract to the temp location (if you selected that) and run the program/script that you specified. Once the program/script closes the folder in the temp location will be removed.
Notes:
If running from a WinPe CD or otherwise similar bootable media do not use "Unpack to Temporary Folder".
WinRAR only has to be on the computer making the sfx archive. Once the sfx archive is made you won't need it to extract the files.