cmd window not displaying progress of 7ZIP

Started by keggymans, April 14, 2015, 02:54:49 AM

Previous topic - Next topic

keggymans

I have a wb exe that has been working fine on XP systems, which runs as part of its process runs a Runwait execution of the locally installed 7-Zip command line utility to zip up files, code as below

RunWait(environment('COMSPEC'),'/c "%zPath%" a -tzip %zipFile% %idxald% >%zipFile%.sending')



But since moving to 32 bit Windows 7 its changed what is displayed within the "CMD" window, as in it no longer shows the progress of the zip, and just has a cursor at the top left of the window, the process itself works fine and the file gets created successfully

I have compiled a test exe just to zip up a test file and it views as expected, yet when the code is run through our automation software it is not working, the automation and the logged on user are the same account, and UAC is turned off

The problem is that many people support these processes and I am worried they will think the process has hung which is not the case

I am aware I can RunHide the process and use some other method of showing progress but this has been working fine and id prefer not to have to rewrite all the programs that use this software to handle zip files

Any Ideas ?

Russell_Williams

When you are runing the 7-zip, you are redirecting the output from the screen into a "sending" text file.
That is from
>%zipFile%.sending

Do you need that "sending" log file for anything else?
If not, take the
>%zipFile%.sending
out of the command line, then the progress will display on the screen instead of going to the file.

It sounds like Windows XP was either ignoring the redirect or incorrectly displaying both on the screen and in the file; while Windows 7 is properly skipping the screen output.

keggymans

yes that makes sense, im only creating the sending file so I can verify post zip that the zip was fully complete, ill have a play with the return codes to see if theres a way of checking without creating the sending file

Thanks
James

kdmoyers

you might also consider the "TEE" command, which is like a T pipe fitting.  It copies the data to a file, and also continues it on to stdout

for example,

DIR C*.EXE | TEE fred.txt

this will direct the output of the DIR command to fred.txt but also let it show on screen too
The mind is everything; What you think, you become.