So I am trying to create batch script that does a findstr
of two variables. I am reading from a specific file where I need the variables from.
The variables I need are
NetPath=
NetPathmed=
And my goal is to use the two variables to do a network map drive. In the first findstr
I need everything after the NetPath=
and in the second I need just a specific amount of data from the string. A normal NetPathMed looks like this
NetPathmed=\\**IPaddress**:C:\folder\file.
I just need the IP address
For example the batch I created looks like this
cd: C:\folder\
set var1="findstr 'NetPath=' file.ini"
for /f "tokens=1,2 delims== " %%a in ("%var1%") do set net=%%a&set path=%%b
Set var2= "findstr 'NetPathMed' opsetup.ini"
for /f "tokens=1,2,3 delims==/ " %%c in ("%var2%") do set net=%%c&set path=%%d &set net=%%e
net use var1(driveletter) \var2(IPaddress)\network folder /persistent:yes