We are testing download an unzip of multiple files. Commands very similar to the ones shows are executed from a batch file (called from SSIS)
C:\Progra~1\WinZip\WINZIP32.EXE -min -e -o -j C:\TEMP\ZipTest\x1.zip C:\TEMP\ZipTest\Z1
C:\Progra~1\Wi开发者_StackOverflow社区nZip\WINZIP32.EXE -min -e -o -j C:\TEMP\ZipTest\x2.zip C:\TEMP\ZipTest\Z2
C:\Progra~1\WinZip\WINZIP32.EXE -min -e -o -j C:\TEMP\ZipTest\x3.zip C:\TEMP\ZipTest\Z3
C:\Progra~1\WinZip\WINZIP32.EXE -min -e -o -j C:\TEMP\ZipTest\x4.zip C:\TEMP\ZipTest\Z4
Unfortunately, after it is done unzipping, four Explorer windows opens up (one for each archive).
While it is easy to close these windows when it runs on my desktop, I cannot close any windows down that open up under the SSIS account.
How do I prevent these windows from opening up?
I'm aware this is an old question, but I ran across it while I was attempting to solve the same problem. My solution is using WinZip 14.5 on a Windows 7 machine.
1) Open WinZip 2) Select the Home tab 3) In the Decompress section select Unzip Options 4) Clear the check-mark in front of Show Unzipped Files 5) Close WinZip and run your script, the Windows Explorer screen should not open
That is probably a setting in winzip GUI. There is a separate command line version that might pan out better but it is available with licensed versions only.
You might want to consider some free command line unzip utilities, if you are not using one of the proprietary winzip compression.
We use the WinZip command line utilities wzzip.exe and wzunzip.exe for just that reason.
I'll bet the server admins will be happy to install wzzip and wzunzip once you explain that the alternative is for them to keep logging onto the box and closing WinZip windows :-)
Use the command line utilities as others have mentioned, or use a third party unzip component like the one available in cozyroc's tools.
you can try writing a script using tasklist and taskkill. here is a perl script that will kill all explorer process that were created after running winzip:
#workaround to close explorer sessions created by winzip
@explorerBeforeWinzip = `tasklist /fi "imagename eq explorer.exe"`;
print "extract zip files\n";
`c:\\Progra~2\\Winzip\\WINZIP32.EXE -min -e -o $zipFile $dest`;
@explorerAfterWinzip = `tasklist /fi "imagename eq explorer.exe"`;
for($i=0;$i<scalar(@explorerAfterWinzip);$i++)
{
$killMe=1;
for($j=0;$j<scalar(@explorerBeforeWinzip);$j++)
{
if($explorerAfterWinzip[$i] eq $explorerBeforeWinzip[$j])
{
$killMe=0;
last;
}
}
if($killMe==1)
{
print "killing process: $explorerAfterWinzip[$i]\n";
$explorerAfterWinzip[$i] =~ m/explorer.exe\s+(\d+)\s+/;
`taskkill /pid $1`;
}
}
精彩评论