Batch File Variables

Posted on 2004-10-07
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 50 total points
ID: 12254127

echo %fname% >> log.txt

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

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

RIA (Rich Internet Application) tools are interactive internet applications which have many of the characteristics of desktop applications. The RIA tools typically deliver output either by the way of a site-specific browser or via browser plug-in. T…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now