Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Read Text File  (Read 2362 times)

0 Members and 1 Guest are viewing this topic.

arfinator

  • Guest
Read Text File
« on: December 27, 2006, 06:05:11 PM »
Hello,

I have a batch file that checks whether a text file exists.  This works fine.  What I would like it to do now, is to read and set the contents of that text file into one variable so that I can execute a shutdown command.

This file is created by another standalone program that works fine, and creates the text file to have arguments in it.  These arguments would be something like -f or something of the sort.  Sometimes in this file, there would be a -c command, and this would signal for another text file to be opened with a comment in it.

I tried doing some of the basic stuff of this with the type command but to no avail.  Does anyone have any suggestions?

Thank you all in advance for any help.

Hess Smith
« Last Edit: December 27, 2006, 06:08:31 PM by arfinator »

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: Read Text File
« Reply #1 on: December 28, 2006, 05:43:45 AM »
On some versions of Windows you can use the for commmand to read files. Full details can be found by typing for /? at any command prompt.

 8-)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein