Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
This is whats in the text file
-------------------------------------------------
Please Wait..........
CentralProfile REG_SZ
CentralProfile REG_SZ
CentralProfile REG_SZ \\ALPLCFP01\PROFILES$\MEBLINE.USR
CentralProfile REG_SZ \\ALXAPFS15\PROFILES$\X2ABERRY.USR
CentralProfile REG_SZ \\ALXAPFS17\PROFILES$\X2BJCUMM.USR
CentralProfile REG_SZ
Press any key to continue . . .
________________________________I would like to go threw and pull out all of the paths(example:\\ALXAGFS17\PROFILES$\X2BJCUMM.USR) and compare each path to a user name (example:x2bjcumm)
If the path matches the username that I input, then that path is put into a variable. If it dosent match, move to the next path and check it.
......................
I've been trying to use this code
-------------------------
for /f "tokens=2 delims=//" %%c in (C:\profile.txt) do (
echo Retrieving %%c
pause
)
--------------------------------------------------
but it just returns the servername(example:ALXAGFS17) Not the entire line.
Any thoughts?

If you want full lines with //
find "//" < myfile
=====================================
If at first you don't succeed, you're about average.M2

Actually I would like to get everything after the \\
I was able to get the full line to print out but I cant seem to get just the patch ex:\\alxbhm\PROFILE$\bobdds.USR

@echo off > newfile & setLocal enableDELAYedexpansion
for /f "tokens=* delims= " %%a in ('find "\\" ^< myfile') do (
for /f "tokens=1* delims=\\" %%i in ("%%a") do (
echo %%j >> newfile
)
)
=====================================
If at first you don't succeed, you're about average.M2

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

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