viewpoint-particle

Author Topic: pipe does not work  (Read 1668 times)

alruma

  • Newbie
  • *
  • Posts: 4
pipe does not work
« on: July 25, 2014, 03:34:47 am »
Hello,
i would like to pipe the screen-output from a WinZip-view into a file with that command:
unZipres = RunWait("C:\Program Files\Winzip\WZUNZIP.EXE",  "-v C:\MOB_PROG\Tools\CUDB_Export\Tests\UnZip\PROD_EXPORT_20140603_0850.ZIP >C:\MOB_PROG\Tools\CUDB_Export\Tests\UnZip\ZipRes2.txt")

But it does not work with RunWait nor RunShell.
i am using 2014A.
The same Unzip-command works well in a DOS-Batch

Regards
Ruedi

snowsnowsnow

  • Full Member
  • ***
  • Posts: 244
Re: pipe does not work
« Reply #1 on: July 25, 2014, 04:56:41 am »
Terminology nitpick: it is called "redirection", not "piping".  Piping is something else.

Substantive answer: The redirection is performed by the shell, not by the command itself, so you have to invoke the shell in order for redirection to be recognized and acted upon.

So, the usual WinBatch idiom for running shell command lines is like this:

RunWait(Environment("COMSPEC"),StrCat("/c ",yourUsualShellCommandHere))

Note that you might also want to look at the recent thread about redirecting the output of DOS commands "into WinBatch".