Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hello. I'm trying to write a batch file that can pull the contents (just a single word) from a text file. I am currently using a batch file to output the user context of a login to a text file.
What I am trying to do is make a batch file which will later take this same information contained in the text file and use it to name a different file.
Hopefully I have not made this too confusing. Thanks, in advance for any advice.

Do you mean the string (word) is at the very begginning of the file, is that it?
If you're on DOS/Win9x, visit my FAQ:
FAQ #25 - Process data inside a file - send first line from file to a variable
If you're on a NT system (Windows NT/2000/XP), use FOR/F
for /F %%S in (filename.ext) do set word=%%S
That line should be executed from inside a batch file. For more information about the FOR cmd, type "for/?" on the command prompt.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br________________________________________________________

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |