Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Command line removal of quotes  (Read 24916 times)

0 Members and 1 Guest are viewing this topic.

John_L.

    Topic Starter


    Rookie

    Thanked: 2
    • Experience: Experienced
    • OS: Windows XP
    Command line removal of quotes
    « 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.

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: Command line removal of quotes
    « Reply #1 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)
    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein