|Here's something to start with:|
if "%1" equ "" (echo need subnet from commandline & goto :eof)
for /f "tokens=4,5,7 delims=. " %%a in ('ipconfig ^| find /i "ip address"') do set subnet=%%a.%%b.%1.%%c
echo subnet ip: %subnet%
This assumes there is only one "ip address" delivered by the ipconfig.
I'm not familiar with subnets, so i'm unsure where to obtain that value from. You would be more knowledgable than me about that aspect. Ipconfig?
@mike: yeh, not sure. I did notice something with commandline, so I edited this to use commandline argument #1 for source.