Hello. If the .CMD is a CL you can do a RTVCLSRC to retrieve the source code. From a command line you can type GO CMDSRC for source commands or GO CMDRTV for retrieve commands.
I would type DSPCMD from the command line to get your information and then do the retrieve.
When you say a “.cmd file”, what operating system are you talking about? It would seem to be for Windows. If so, then just open it with Notepad.