Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to write a batch file that will create a popup window for the user to input some specific information, and place that information into a text file? The text file should already have some text in it but I just want a couple lines to have input from the user. This is what the text file should look like:


Where it says "USER INPUT1,2" is where I want the information from the user placed.

Any help would be great!

share|improve this question

You can use set /p to ask the user for input:

set /p SomeVar=What is your favourite colour? 
echo Favourite colour: %SomeVar%
share|improve this answer
This is exactly what i was looking for. Thank you!! – John Z Jan 29 '13 at 16:24

This will ask for four values, then print the resulting file to the desktop. It will append to the same file everytime you run this, unless you delete the file.

@echo off
set Output="%USERPROFILE%\desktop"

set /p VarOne=Enter variable one value: 
set /p VarTwo=Enter variable two value: 
set /p VarThree=Enter variable three value: 
set /p VarFour=Enter variable four value: 

REM enter your desired output here
echo Variable One   = %VarOne% >> %Output%\test.txt
echo Variable Two   = %VarTwo% >> %Output%\test.txt
echo Variable Three = %VarThree% >> %Output%\test.txt
echo Variable Four  = %VarFour% >> %Output%\test.txt

echo File has been placed %Output%
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.