notepad++nppexec

Notepad++: Script to send input to running program?


I compile and run many .c files in notepad++ using this code

NPP_SAVE
g++.exe -g "$(FULL_CURRENT_PATH)" 
a

Now what I want is that each time after compilation and running, an input is also sent to the program. Something like below

NPP_SAVE
g++.exe -g "$(FULL_CURRENT_PATH)" 
a
28 10 1985 //this is the input to the program a

I have a lot of .c files to check if they give correct output when provided a date.


Solution

  • The solution to redirect input from file using nppexec is to use cmd

    cmd /c g++ -o $(NAME_PART).exe $(FILE_NAME) && $(CURRENT_DIRECTORY)\$(NAME_PART).exe < input.txt