This is a simple Windows 32-bit program that will pop a dialog box with the list of all the command-line agruments it received.
The idea is that you build the executable printargs.exe. You rename it to whatever target program call you're trobleshooting and replace the target program with it temporarily. If it's called at all, it will reveal command-line parameters, passed to that target program.
You'll need some version of Microsoft Visual C++ compiler to build executable. I wrote this program in 2001 and originally used Visual C++ 6.0, but I tried more recently Visual C++ 2015, and it still compiles, although with lots of warnings, which I may eventually address.
- Open cmd.exe prompt and run vcvars, for example on my system I run this:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat".
- Validate that vcvars did it's job:
echo %INCLUDE%. You should see something like this:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\INCLUDE;....
- Switch to folder where printargs.c is:
cd Documents\GitHub\misc\printargs. Run
dir, you should see
- Run command-line compiler:
cl printargs.c shell32.lib user32.lib. This should produce a lot of warnings about type casting and
I also created a batch file build.bat that does the same.