I have written small program for that. It sends http get request to
www.whatismyip.com and picks ip address reply. You can run it from command prompt or script and pipe result to file. I could publish my utilty, but don't know good place to do it. You shouldn't trust if unknown person sends you program file by email.
You might be able to do it with visual basic script, but I don't know how. What you have to do is to open tcp connection to host
www.whatismyip.com using port 80 and send string "GET http://www.whatismyip.com/" plus CR+LF. When you read reply from socket you get html page. Find "<TITLE>" where is string "Your ip is xx.xx.xx.xx".