set result of FINDSTR in FOR

March 18, 2009 at 13:57:16
Specs: Windows 2003
Hi,
I need to extract the result of the follwing to a new variable called "DominoServiceName"

for %%T in ("c:\program files\lotus\domino\notes.ini") do findstr "ServiceName" %%T

The output of the FINDSTR in the FOR statement is:

ServiceName=Lotus Domino Server (ProgramFilesLotusDominodata)

I just want to set the part after "ServiceName=" to DominoServiceName

Thanks,
....David.


See More: set result of FINDSTR in FOR

Report •


#1
March 18, 2009 at 14:40:15
@echo off & setLocal EnableDelayedExpansion

::pushd "c:\program files\lotus\domino"

for /f "tokens=1* delims==" %%a in ('find "ServiceName" ^< notes.ini') do (
set DominoServiceName=%%b
)
echo !DominoServiceName!


=====================================
If at first you don't succeed, you're about average.

M2


Report •

#2
March 18, 2009 at 14:53:38
M2,
Thank you so much for your accurate and speedy solution!
....David.

Report •

Related Solutions


Ask Question