Quantcast
Channel: Windows Server General Forum forum
Viewing all articles
Browse latest Browse all 24879

for loop batch file

$
0
0

how do I get this syntax corected

For /F %%A in (computers.txt) && for /F %%B in (users.txt) do (
    for /f "tokens=2" %%i in ('qwinsta /SERVER:%%A ^| find /i %%B') do echo %%i | rwinsta %%i /SERVER:%%A /V
)

i want to terminate all users sessions from the users.txt file on all the computers.txt file


Viewing all articles
Browse latest Browse all 24879


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>