How To Test Command Line Parameters the Easy Way

Sometimes it’s necessary to call a program and pass some command line parameters, this can be difficult to test as the other program may not be under your control or may be a live system. To test calling another program with command line parameters create a text file, name it ‘DisplayCommandLine.bat’, and insert the following text:


@echo off
@echo %*
pause

Then in your calling program simply substitute ‘CommandLine.bat’ for the program name and you’ll soon be able to see exactly what is being passed from one program to the other.