[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Batch File Variables

Posted on 2004-10-07
2
Medium Priority
?
243 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 150 total points
ID: 12254127
Or:

echo %fname% >> log.txt

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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.
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Six Sigma Control Plans
Progress

656 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