Glenn BarnasAdministrator
(KiX Supporter)
2009-06-22 08:59 PM
Wondering...

Anyone have a clue what valid purpose the following code might have?
 Code:
Break On
Shell ("cmd.exe /c echo off")
It's at the start of every Kix script in a package that I was asked to review. I know the actual syntax is incorrect, and "cmd.exe" is not as flexible as %COMSPEC%, but why run "echo off" from a shell in a Kix script? Just wondering if I'm missing something that's not immediately obvious. To me, it's running a command that says "Echo is Off" and then exits.

Glenn


AllenAdministrator
(KiX Supporter)
2009-06-22 09:11 PM
Re: Wondering...

You are right, it's not doing anything but turning off the echo for that one line... lol.... @echo off would have been better, but I bet they didnt think it work because of the @... and the parenthesis of course not needed... rofl...

Glenn BarnasAdministrator
(KiX Supporter)
2009-06-23 12:44 AM
Re: Wondering...

Looking further at the code, I wonder if they were trying to eliminate the return codes. \:D

Glenn


Richard H.Administrator
(KiX Supporter)
2009-06-23 09:05 AM
Re: Wondering...

 Originally Posted By: Glenn Barnas
Looking further at the code, I wonder if they were trying to eliminate the return codes. \:D

Glenn


...or trying to suppress the output of later shelled commands.

I can't think of a valid use for it other than maybe testing for a working cmd.exe or as a kludgy way to initialise @ERROR

But I think that you probably have the right answer.