Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
batch file - need to remove the trailing :
Name: gm22 Date: May 20, 2009 at 09:34:10 Pacific OS: Windows Vista Subcategory: Batch
Comment:
Here is what I have:
@ECHO OFF
FOR /F "tokens=3" %%A IN ('PING www.google.com -n 1 ^| find "Reply from"') DO SET output=%%A
echo %output%
The output that I get is an IP address with the : at the end - e.g., 216.239.61.104:
I need the IP address without the : at the end, e.g., 216.239.61.104
=================
Starting EC2 instance i-8xxx3e8... Started
Your server is now available at hhttp://ec2-10-10-10-10.compute-1.amazonaws.com
=================
I want my batch file to find the line that starts with "Your server is now available" and extract the "ec2-10-10-10-10.compute-1.amazonaws.com" (hostname without the http bit) and then use this in the above batch script (PING ec2-10-10-10-10.compute-1.amazonaws.com) in order to get the IP address.
Thank you again for your help.
GM
0
Response Number 5
Name: Mechanix2Go Date: May 21, 2009 at 00:34:39 Pacific
Reply:
Assuming that hhttp is a typo and really should be:
http
================================== @echo off & setLocal EnableDelayedExpansion
for /f "tokens=7 delims= " %%a in ('find "Your server" ^< server.txt') do ( set site=%%a set site=!site:http://=! echo !site! )
===================================== If at first you don't succeed, you're about average.
Summary: Hi i need to know how to create a batch file that, besides recording the pinging of an IP device, adds the TIME of each PING at the end of each line e.g. Out put to look like this: Reply from 172.16.1...
Summary: Hi, I’m stuck on part of a batch file I’m working on. What I’m trying to do is copy all files with the extension JPE in a directory to another directory, adding “ (E-mail Size)” to the file name and m...
Summary: I have a ton of pc's that that I need to remove the C:\documents and settings\userprofiles\Start Menu\Programs\Winzip\ files from that directory. I also have a text file that has all the pc names ...