Save to file from command line operation and named it as [hostname].txt
7,988
You want the %computername%
environment variable.
So, the command you need is ipconfig /displaydns >%computername%.txt
You can find a more complete list of environmental variables in Daniel Beck's answer
Related videos on Youtube
Author by
ehh
Updated on September 18, 2022Comments
-
ehh over 1 year
I am wondering if it is possible to save the following operation to a file while the name of the file is the host name:
I mean something like:
ipconfig /displaydns >hostname.txt
For example, in case my PC name is ehh then it will save to ehh.txt file
-
ehh about 7 yearsGreat, works perfectly!!!