Batch File Variables

Posted on 2004-10-07
Medium Priority
Last Modified: 2010-04-17
I would like to know how to copy variable information to a text file. My variable would be set up like this:
set /p fname=Type your first name:
For this instance, I would want to copy %fname% to a text file called log.txt.
Question by:foxdesignz
  • 2

Expert Comment

ID: 12254122

copy %fname% log.txt

or maybe,

echo %fname% > log.txt

if you want the name put into the file

Accepted Solution

LRHGuy earned 150 total points
ID: 12254127

echo %fname% >> log.txt

to append the value of fname to the log.txt file.

Featured Post

7 new features that'll make your work life better

It’s our mission to create a product that solves the huge challenges you face at work every day. In case you missed it, here are 7 delightful things we've added recently to monday to make it even more awesome.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Today, unlike web development, the mobile landscape is complex enough for a software engineer and Android is posing more challenging environment thanks to its fragmentation issues on hardware and software fronts.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question