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

Author Topic: How to insert the '&' Symbol in variables  (Read 3295 times)

0 Members and 1 Guest are viewing this topic.

warlocke

    Topic Starter


    Starter

    • Experience: Familiar
    • OS: Windows 10
    How to insert the '&' Symbol in variables
    « on: August 30, 2017, 11:14:37 PM »
    I wanted to make something like this,
    set ab=&hello
    But it will say Hello is not a command. Anyone have an idea?
    « Last Edit: August 30, 2017, 11:37:01 PM by warlocke »

    Salmon Trout

    • Guest
    Re: How to insert the '&' Symbol in variables
    « Reply #1 on: August 31, 2017, 11:23:07 AM »
    Code: [Select]
    C:\>set ab=^^^&hello

    C:\>echo %ab%
    &hello

    Squashman



      Specialist
    • Thanked: 134
    • Experience: Experienced
    • OS: Other
    Re: How to insert the '&' Symbol in variables
    « Reply #2 on: August 31, 2017, 11:25:22 PM »
    Code: [Select]
    C:\>set "ab=^&hello"

    C:\>echo %ab%
    &hello

    C:\>set "ab=&hello"

    C:\>set /p ".=%ab%"<nul
    &hello
    « Last Edit: August 31, 2017, 11:50:49 PM by Squashman »