Problem with converter for zip files

Post your bug reports here.
Post Reply
jdan
Posts: 17
Joined: Tue Feb 20, 2007 5:13 am

Problem with converter for zip files

Post by jdan »

This may not be a bug, but I'm having difficulty getting a converter set up.

I wan to set up a converter for zip files, using wzzip.exe for winzip.

I have set up a converter like this, but it does not seem to work. It always says the files are identical, and it shows both zip files as empty files.

Here is the converter I set up:
Name: Zip2txt
Mask: *.zip
Command: C:\Program Files\WinZip\8\WZZIP.EXE
Arguments: -vn -ybc {$Source_File} >{$Converted_File}

But if I set up a converter that calls the same command through a batch file, like this, it works file:
Name: Zip2Txt
Mask: *.zip
Command: c:\zip2txt.bat
Arguments: {$Source_File} {$Converted_File}

c:\zip2txt.bat:
"C:\Program Files\WinZip\8\WZZIP.EXE" -vn -ybc %1 >%2

What am I doing wrong?

grigsoft
Site Admin
Posts: 1673
Joined: Tue Sep 23, 2003 7:37 pm
Contact:

Post by grigsoft »

The problem is piping (>) is processed by command shell only - it will not work if I start this command line myself. It's possible to process this command myself, as I do in Synchronize It!, but it requires a bit different approach. Currently it is not supported - maybe I could add an converter option like "Redirect output to target file". But, as you said, this problem is easil;y solved with batch file.

jdan
Posts: 17
Joined: Tue Feb 20, 2007 5:13 am

Post by jdan »

Well that explains it. Then I won't continue to try it any more.

I suppose that when wincmp launchs the external app for a converter, it could always launch the application as a command line parameter to the cmd.exe program (the command shell), using rhe /C option so that you always launch the shell to launch everything else.

But the batch file works for now.

TonHu
Posts: 100
Joined: Mon Sep 29, 2003 10:48 am
Location: Netherlands

Post by TonHu »

A disadvantage of both a batchfile and directly calling cmd /c could be the maximum linelength that is supported by cmd.exe. I'm in the impression it's about 512 bytes, but I'm not really sure, and also didn't search for it (yet), I'll do that later.

HTH
Ton

jdan
Posts: 17
Joined: Tue Feb 20, 2007 5:13 am

Post by jdan »

It looks like there is a maximum length:

http://support.microsoft.com/kb/830473:
On computers running Microsoft Windows XP or later, the maximum length of the string that you can use at the command prompt is 8191 characters. On computers running Microsoft Windows 2000 or Windows NT 4.0, the maximum length of the string that you can use at the command prompt is 2047 characters.

It looks like this should be adequate to cover most situations.

Post Reply