Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I want to create vars from txtfile with multiple lines..
txtfile (directories.txt) looks like..
C:\test\00010010
C:\test\00010020
C:\test\00010030(dir %1 /AD /B /S > directories.txt)..
I want to make a var per line in my batch script
another solution could be to create the vars directly instead of producing the txtfile..?
anyone? and thanks in advance!

Begin your batch by coding
@echo off & setlocal EnableDelayedExpansionthen
set N=0 for /F "delims=" %%j in ('dir "%~1" /AD /B /S') do ( set /A N+=1 set var!N!=%%j ) for /L %%j in (1 1 %N%) do echo.!var%%j!

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |