NIck
CP/M puts it command line arguments in a buffer starting at 80h, prefilling fcbs at 5ch and 6ch with parsed file names for the first 2 arguments. Unfortunately, it doesn't save the invoking command in this argument list.
A C implementation would usually covert this command line into standard argc,argv format. Any argv[0] would have to be set to a fixed value during this conversion and is usually the null string. By modifying the conversion routines to put your own string would at least give a more reasonable value, however renaming your application would not change this fixed name.
By way of an example, the hitech C compiler startup code contains a data label nularg which is a null string. This is what initialises argv[0], replacing this, possibly by moving to your own code, would allow argv[0] to be set.
Alternatively, to make your code portable to non CP/M systems testing for a null or null string argv[0] would allow you to replace argv[0] with your own string.
In principle you could probe the ccp in memory before it is overwritten, for the invoking name. However, this is likely to require CP/M version specific code. For example CP/M 2.2 uses a buffer at ccpbase + 8 for processing, so the name may be there.
Be aware some applications like a debugger, overwrite the ccp when they load.
Mark