For loop using two variables

March 29, 2012 at 06:18:44
Specs: Windows 7
Hello, i am using the following code which reads a username from user.txt.

FOR /F %%i IN (user.txt) DO xcacls \\test.test\files\userdata\PATH\%%i /T /P %%i:F administrators:F /Y

however, i wish to be able to read the PATH from a text file named organization.txt.
Anyone know how that can be done?

See More: For loop using two variables

Report •

April 10, 2012 at 23:27:58
PATH? do you mean where it is located or a location in the file
if it is a location in the file then there are plenty of ways
one way that is not very known and so awesome (got it from

Set /P _MyVar=<MyFilename.txt

that gets the first line of a txt file
hope it helps

Report •

April 13, 2012 at 00:54:24
If the path changes every time your loop through remember to enable delayedexpansion too.


Elinor Hurst

Report •
Related Solutions

Ask Question