Before we begin, here's a tip: never name a batch script or vbs script with the same name of an executable in windows, part of the path variable.
Meaning: if script is called ipconfig.cmd and you already have an ipconfig.exe it'll create an execution loop. Thus, this script must ne named anything except ipconfig.cmd.
This script will output your external IP address, and the entire contents of ipconfig /all command in a temporary text file on your desktop and opens the file.
It is easier to read and copy from notepad than from a command line window. The script will remain open as long as the text file is openend. When you close notepad the file will dele itself.
The code for the script is:
Code:set "output=%userprofile%\desktop\ipconfig_%random%.txt" bitsadmin.exe /transfer "Job1" http://ipv4.icanhazip.com/ "%output%" set /p ExternalIP=<"%output%" echo(>"%output%" && echo(Script Data>>"%output%" && echo(>>"%output%" && echo( External IP . . . . . . . . . . . : %ExternalIP%>>"%output%" ipconfig /all >>"%output%" notepad "%output%" del "%output%"
Bookmarks