Creating a batch utility script on Windows 7 to invoke an executable. It essentially works, EXCEPT that my second IF statement. Tried a number of different things.
My intent is to invoke 'DoSomething' for each command line argument. That part works! The second IF statement prints a help message only if there no parameters given on the command line. Well, that's the intent. That's not what it's doing.
@ECHO OFF
:Start
SET a_file_was_processed="false"
IF "%1" NEQ "" (
SET a_file_was_processed="true"
ECHO Extracting table %1 from database.
DoSomething word%1 > output_%1.txt
ECHO Finished extract table to file output_%1.txt
SHIFT
GOTO Start
)
if a_file_was_processed NEQ "true" (
ECHO Invoke this script as: Extract_From_sdf table_name1 table_name2
)
Ideas?