How to receive a variable in CMD file when users keys name of cmd file plus variable? [duplicate]

I want the user to be able to key the name of the CMD, and an optional variable to be passed to the CMD. Would that just be CMD-name variable? Or ….

  • In the CMD file, how do I receive that variable?
  • What if the user does not pass the variable, but just keys CMD-name? What would CMD-name receive?