Create text file based on user input

October 28, 2009 at 21:45:30
Specs: Windows 7
I would like to make a batch file, which I think
would be easiest, to create a text file named

In userinput.cfg, I want it to create this line:

user_input_key = "whatever they type"

The "whatever they type" I want to be based
on user input, like a prompt to enter the text
which puts it in the quotes.

Also, I would like it to place this file in an
existing directory.

I want it to be (current base directory they're
using (IE: C: or E:))\Program Files or Program

So in the end, they have a new file in this
directory with a new line, part of that line being
based on userinput.

Also, because I have no idea of the
complexities of this, I'd like it to add the above
line to the file if it already exist.

I hope this is all clear enough, I'll try to
respond to any questions you have about my
request promptly. I'm a complete novice to
programming and decided this would be an
excellent place to get help. I'm not completely
sure this can be done in Batch, or if it's the
correct choice for my request. Thanks for any
and all help.

See More: Create text file based on user input

Report •

November 2, 2009 at 23:36:38
Hi, pcuser12

here's the code buddy..

@echo off
color A
@echo Enter the name of the file which u want to create
set /p n=Console:
Date /t >> %n%.log

It creates user desired file in the same folder..

Keep smiling :-)

Report •
Related Solutions

Ask Question