Could anyone tell me as to how I can get the DHCP address using wmic command. I need the LAN DHCP and the WiFi DHCP. Is there a WHERE clause I could use to get this. The output has to be in a single line.
Let me paste the code below which will help you understand The last line of the below code is what I tried for DHCP but I am unable to filter it out exactly. My only question is, similar to how I got the HDD space using the where clause, is there a similar where clause for obtaining the DHCP address of LAN and WiFi.
@echo off
for /f "delims== tokens=2" %%i in ('wmic path win32_logicaldisk where "drivetype = 3" get size /value') do SET HDDSIZE=%%i
for /f "delims== tokens=2" %%i in ('wmic path Win32_NetworkAdapterConfiguration where "ipenabled=true" get dhcpserver /value') do SET DHCP=%%i
set outputfile="C:\dell\%SERVICETAG%.csv"
echo HDDSize,DHCP>>%outputfile%
echo %HDDSIZE%,%DHCP%>>%outputfile%