Computer Hope

Microsoft => Microsoft DOS => Topic started by: John_L. on July 10, 2021, 09:14:22 AM

Title: Command line removal of quotes
Post by: John_L. on July 10, 2021, 09:14:22 AM
I consulted the "cmd /?" help, and it is clear as mud.

I am passing an argument to a command line program, that may contain spaces.

I thought this would work;

pgm.exe "one one-and-one"

but the PGM is complaining of a " character, that I thought the command line processor would be kind enough to remove.

Thanks in advance for the correct DOS incantation.
Title: Re: Command line removal of quotes
Post by: Sidewinder on July 10, 2021, 11:35:16 AM
You can use the set keyword to format the multiword parameter into a single word variable:

Code: [Select]
set var=one one-and-one
pgm.exe %var%

 8)