command line - Need batch file to print the IPV4 Address, Subnet, Gateway and DNS Servers to a text file please -
i trying automate task work - doing screenshots of ipconfig /all screen need ipv4 address, subnet, gateway ad dns servers.
i can ip address print using following:
echo ipaddress is: >> admin.doc /f "tokens=1-2 delims=:" %%a in ('ipconfig^|find "ipv4"') set ip=%%b set ip=%ip:~1% echo %ip% >> admin.doc
i have several tasks need automate , updating document each task.
for /f "tokens=1-5 delims=," %a in ('wmic nicconfig ipaddress^,ipsubnet^,dnshostname^,defaultipgateway /format:csv') echo %a - %b - %c - %d - %e
or perhaps
for /f "tokens=2-5 delims=," %a in ('wmic nicconfig ipaddress^,ipsubnet^,dnshostname^,defaultipgateway /format:csv') echo %a - %b - %c - %d
or
wmic nicconfig ipaddress^,ipsubnet^,dnshostname^,defaultipgateway /format:csv > file.txt
or
wmic /output:"file.txt" nicconfig ipaddress^,ipsubnet^,dnshostname^,defaultipgateway /format:csv
see wmic /?
, wmic /node /?
, wmic /output /?
, wmic /append /?
, wmic nicconfig /?
, wmic nicconfig /?
, wmic nicconfig call /?
, wmic nicconfig set /?
, wmic /format /?
.
Comments
Post a Comment