Knowledge Walls
John Peter
Pune, Maharashtra, India
Things to Know [cont'd]
File content to variable in Things to Know of MS-DOS Commands
5697 Views
How to load file content to a variable in MS DOS batch files? 
< less than arrow is used to assign the value from a file to variable in ms dos.
Example
@echo off

SET /P file_contents=<data.txt
echo %file_contents%
Data.txt 
MS DOS - Microsoft Disk Operating System
Output 
Next Topics
Next lessons of current book.
Things to Know of MS-DOS Commands
Decision making of MS-DOS Commands
Previous Topics
Previous lessons of current book.
Things to Know of MS-DOS Commands
String manipulation of MS-DOS Commands
Best Lessons of "MS-DOS Commands"
Top lessons which are viewed more times.
Arithmetic Operators of MS-DOS Commands
Arithmetic Operators of MS-DOS Commands
Relational Operators of MS-DOS Commands
String manipulation of MS-DOS Commands
String manipulation of MS-DOS Commands
String manipulation of MS-DOS Commands
Things to Know of MS-DOS Commands
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details