Windows 7 set /p not working

Discussion in 'Programming and Scripting' started by brainuee, Jul 7, 2013.

  1. brainuee

    brainuee New Member

    Joined:
    Jul 7, 2013
    Messages:
    7
    Likes Received:
    0
    The following code doesnt set the value of a to user input..why? Can anyone help plz...


    set /p a ="sdff "
    pause
    echo %a%
    pause
     
  2. Josephur

    Josephur Windows Forum Admin
    Staff Member Premium Supporter

    Joined:
    Aug 3, 2010
    Messages:
    1,018
    Likes Received:
    125
    /p is meant to take input, so if you do
    set /p a ="sdff "
    (type some data in here)
    echo %a%

    The system will prompt you with "sdff", the typed data is what %a% will be!
     

Share This Page

Loading...