how to store a substr in a variable in batch

April 10, 2011 at 22:57:14
Specs: Windows XP
Hi,

I have a line "Ethernet adapter Local Area Connection 3:" in a variable called %%a that has been passed to a subroutine in my batch script.
Now i want to store the string -"Local Area Connection 3" to a new variable. Please suggest how this can be achieved. Also note that that the the number( 3 ) in the string is dynamic.

Thanks
Sumit gupta


See More: how to store a substr in a variable in batch

Report •


#1
April 10, 2011 at 23:22:21
@echo off & setLocal enableDELAYedeXpansioN

call :sub1 Ethernet adapter Local Area Connection 3
echo.!V!

goto :eof

:sub1
set V=%3 %4 %5 %6
goto :eof


=====================================
Life is too important to be taken seriously.

M2


Report •

#2
April 12, 2011 at 02:04:06
Thanks ! :)

Report •
Related Solutions


Ask Question