Search found 2 matches

by matt_thumper
04 Feb 2013 07:05
Forum: DOS Batch Forum
Topic: Set a variable to file contents
Replies: 3
Views: 4297

Re: Set a variable to file contents

foxidrive wrote:

Code: Select all

@echo off
set /p "a="<mydatefile.txt
echo "%a%"
pause


Worked great.
Just what I was looking for!

Thanks,
Matt
:D
by matt_thumper
04 Feb 2013 05:56
Forum: DOS Batch Forum
Topic: Set a variable to file contents
Replies: 3
Views: 4297

Set a variable to file contents

Hi, How to I grab the (simple) contents of a file (which will be YYYYMMDD each day) and assign it to a variable? So, the file mydatefile.txt contains 20130204 and I want the batch script to assign '20130204' to the variable a. (All of the ancillary things I've worked thru, and can do - except for a...