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

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -

java - Digest auth with Spring Security using javaconfig -