Just a little thought. Wouldn't it be easier to skip the whole "delims" thing and use: FOR /F "TOKENS=15" %%A IN ('IPCONFIG /ALL^|FIND "DHCP Server"') DO @SET DHCPSERVER=%%A or if you insist in using delims use this: FOR /F "TOKENS=2,* DELIMS=:. " %%A IN ('IPCONFIG /ALL ^| FIND "DHCP Server"') DO @SET DHCPSERVER=%%B BTW: Delims doesn't treat an uppercase and lowercase character the same way.