Trying to execute self extracting zip file silently in command line

末鹿安然 提交于 2019-12-10 19:01:52

问题


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


回答1:


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:

UPS_319_117.exe /auto .\upstemp\

(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...




回答2:


You can usually unzip these using a third-party ZIP extraction utility.




回答3:


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?



来源:https://stackoverflow.com/questions/8362615/trying-to-execute-self-extracting-zip-file-silently-in-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!