String from file, how to set it as a Variable?

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
Xboxer
Posts: 25
Joined: 27 Nov 2014 13:58

Re: String from file, how to set it as a Variable?

#16 Post by Xboxer » 02 Dec 2014 20:32

3rd party, but instant results! 8)

Code: Select all

@echo off
:: WhatIsMyIP.cmd - returns public IP address
:: requires: wget.exe
wget -q -O %temp%\MyIP http://icanhazip.com
for /f "delims= " %%G in (%temp%\myip) do set PublicIP=%%G & del %temp%\MyIP
echo. & echo Your public IP address is: %PublicIP% & echo.
>Nul Timeout 5

Post Reply