“set” command not working properly while running batch file through NppExec plugin of Notepad++

NppExec
Star Wars
2014-04-16
2014-04-17
  • Star Wars
    Star Wars
    2014-04-16

    Consider this batch file :
    @echo off
    set /p var1=Input your first name and press Enter key :
    set /p var2=Input your last name and press Enter key :
    pause

    If I run this batch file by double clicking on it, it works fine.
    But if it is run through console window of NppExec plugin of Notepad++, it only waits for first input.
    Probably, "enter" key pressed by user is taken as input for second "set" command.

    One solution may be to insert one more "set" command before second "set" as:
    @echo off
    set /p var1=Input your first name and press Enter key :
    set /p temp=
    set /p var2=Input your last name and press Enter key :
    pause

    But then problem will arise, when this batch file wiil be run through command prompt or simply by double clicking on it (will wait for three inputs). Is there any way to solve this?

    I also posted this question here but unfortunately could not get solution:
    http://stackoverflow.com/questions/23009083/set-command-not-working-properly-while-running-batch-file-through-nppexec-plug

     
    Last edit: Star Wars 2014-04-16
  • DV
    DV
    2014-04-17

    An interesting use-case it is, and Master Yoda doesn't have the solution for the moment, unfortunately.
    I'm afraid the best suggestion now would be to workaround the problem by either running the batch file in its own console via NPP_RUN or to use INPUTBOX to ask for the parameters from NppExec and then pass these parameters as arguments to the batch file.