尝试在命令行中静默执行自解压 zip 文件
我有这些自解压 zip 文件,我正在尝试在 2008/7 机器上远程解压它们。但它们以 .exe 的形式出现,需要用户双击并选择提取位置。
在 WinZip 支持网站上,他们说要使用 /auto 标志,因此命令将如下所示:
C:\deploy\.exe /auto C:\path\\
它在任务管理器中启动该进程,但永远卡在那里。
当我在文本编辑器中打开文件时,它显示:!此程序无法在 DOS 模式下运行。
所以也许你们中的任何人都知道我如何自动自动提取自解压文件。或者也许有一种方法可以使用应答文件运行它们。
谢谢
I have these self extracting zip files that I'm trying to extract on 2008/7 machines remotely. But they are coming in a way of .exe and it require user to double click and choose the extractions location.
On WinZip support site they saying to use the /auto flag so the command will look like that:
C:\deploy\.exe /auto C:\path\\
It starts the process in the task manager but it stuck there foever.
When I'm opening the file in text editor it says: !This program cannot be run in DOS mode.
So maybe anyone of you know how I can automate the extraction of the self extraction file silently. Or maybe there is a way to run them with answer file.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我知道这是旧的,但我刚刚发现这个页面试图做同样的事情(对于静默驱动程序安装)
上面的OP工作正常。
例如,我的行是:(
这是在批处理文件创建 upstemp 文件夹之后)。我的猜测是路径错误,因此自解压在OP的情况下遇到了错误,或者类似的事情,它只是挂起等待输入,因为它处于自动模式,所以不会发生......
I know this is older, but I just found this page trying to do the same thing (for a silent driver install)
What the OP put up above works fine.
For example, my line was:
(This was after having the batch file create the upstemp folder). My guess is either the path was wrong so the self-extracting hit an error in the OP's case, or something along those lines and it just hung up waiting for input that wouldn't happen since it was in auto mode...
您通常可以使用第三方 ZIP 提取实用程序来解压缩这些文件。
You can usually unzip these using a third-party ZIP extraction utility.
我也有同样的问题。我最终用PowerShell解决了这个问题。将 .exe 文件重命名为 .zip 文件。然后运行如下命令:
powershell -Command "MD C:\PathWhereFileShouldExtractTo; $shell = New-Object -ComObject shell.application; $zip = $shell.NameSpace('C:\PathToZipFile\YourFile.zip'); foreach PathWhereFileShouldExtractTo').CopyHere($item);
($zip.items() 中的 $item) {; $shell.Namespace('C: \ 本文中有关如何使用 Powershell 解压缩文件的基本 PowerShell 命令:如何在 Powershell 中解压缩文件?
I had the same problem. I eventually resolved it with PowerShell. Rename your .exe file to a .zip file. Then run a command like this:
powershell -Command "MD C:\PathWhereFileShouldExtractTo; $shell = New-Object -ComObject shell.application; $zip = $shell.NameSpace('C:\PathToZipFile\YourFile.zip'); foreach ($item in $zip.items()) {; $shell.Namespace('C:\PathWhereFileShouldExtractTo').CopyHere($item); }"
I stole the basic PowerShell commands from this article about how to unzip a file with Powershell: How to unzip a file in Powershell?