Solved

Batch File Variables

Posted on 2004-10-07
2
240 Views
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.
 
0
Comment
Question by:foxdesignz
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 7

Expert Comment

by:LRHGuy
ID: 12254122
Try:

copy %fname% log.txt

or maybe,

echo %fname% > log.txt

if you want the name put into the file
0
 
LVL 7

Accepted Solution

by:
LRHGuy earned 50 total points
ID: 12254127
Or:

echo %fname% >> log.txt

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 118
VBA Challenge how to code to loop through all files in folder and revise some part of the codes 15 82
asp Google Map 2 65
"lblTime is not declared" 3 36
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
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 …

730 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