?
Solved

Tracert Monitor

Posted on 2011-05-07
31
Medium Priority
?
656 Views
Last Modified: 2012-06-27
hello
can this script be modified so it searches only a specific part of a txt file?
example:
right now running the script, FileName.vbs c:\FileLocation.txt 50 100 will find all values between 50 and 100, but this does not really work when you are scanning a trace route.  i need it to scan the first 4 columns of the tracert output and find the specified range.  can anyone help?  

i'm open to doing this a different way on a windows system.  batch file or vbs

argsCount = Wscript.Arguments.Count
if argsCount<>3 then
wscript.echo "Error: Wrong number of arguments (expected 3)"
wscript.quit
end if

dim lbound,ubound,data,ch,int
Set objFSO = CreateObject("Scripting.FileSystemObject")

file = Wscript.Arguments(0)
lbound = cInt(Wscript.Arguments(1))
ubound = cInt(Wscript.Arguments(2))

set objFile = objFSO.OpenTextFile(file, 1)

data = objFile.ReadAll
objFile.Close
token=""

for i=1 to len(data)

      ch = Mid(data,i,1)
      if IsNumeric(ch) = true then
            token = token & ch
      else
            if token <> "" then
                  int=cInt(token)
                  if int>=lbound and int<=ubound then
                        ''token is within range, send the email...
                        wscript.echo lbound & ">" & token & "<" & ubound
                  end if
                  token=""
            end if      
      end if
next
0
Comment
Question by:eli2011
  • 16
  • 12
  • 2
  • +1
31 Comments
 
LVL 39

Expert Comment

by:BillDL
ID: 35714313
What parameters/switches are you using with the TRACERT command to create your text file of results?

tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name

-d   Do not resolve addresses to host names.
-h   Maximum number of hops to search for target.
-j    Loose source route along the host-list.
-w  Timeout for each reply in milliseconds.
target_name    Name or IP address of the target host.

It should be possible to execute the command in a batch file and parse the output, splitting up each line into values in each column, and check if the values are within range.  There are a lot of other experts here who are more proficient at this type of thing than I am, but I can have a go if no others come along with a solution shortly.
0
 

Author Comment

by:eli2011
ID: 35715330
i'm not using any of the switches they didn't seem to help.

ok thanks,
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35715688
What do you mean by: " i need it to scan the first 4 columns of the tracert output and find the specified range.  can anyone help? "

Could you please give an example a a tracert text file and the range you are talking about?

In the mean while, I'v done a batch file that does what you asked, that is: "will find all values between 50 and 100"

 
@ECHO OFF

SET Dest=yahoo.com
SET LineStart=2
SET /a LineStartWithHeader=%LineStart% + 3
SET LineEnd=3

ECHO METHOD 1
FOR /F "skip=%LineStartWithHeader% delims=" %%A IN ('Tracert -h %LineEnd% %Dest% ^| Findstr -v "complete"') DO ECHO %%A
ECHO.

ECHO METHOD 2
FOR /F "skip=3 tokens=1* delims= " %%A IN ('Tracert -h %LineEnd% %Dest%') DO IF %%A GEQ %LineStart% IF %%A LEQ %LineEnd% ECHO %%A %%B


PAUSE

Open in new window

0
Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

 
LVL 10

Expert Comment

by:ReneGe
ID: 35715697
Just change LineStart and LineEnd as needed and Dest as needed.
0
 

Author Comment

by:eli2011
ID: 35715912
here are some hops to yahoo.com.  when i output this to a .txt file i need the script to scan just first 4 columns within a set range....in this case 50-100  i don't want it to scan dns/ip section of the each line.

on your batch script, how do you modify the range, lets say i want to use 100-200?

   
C:\>tracert yahoo.com


Tracing route to yahoo.com [67.195.160.76]
over a maximum of 30 hops:

  6    69 ms    70 ms    68 ms  cr2.ormfl.ip.att.net [12.122.106.118]
  7    81 ms    79 ms    80 ms  cr81.fldfl.ip.att.net [12.122.1.46]
  8    65 ms    67 ms    66 ms  fldfl01jt.ip.att.net [12.122.81.25]
  9    82 ms    74 ms    82 ms  192.205.36.254
 10    81 ms    90 ms    83 ms  ae-32-52.ebr2.Miami1.Level3.net [4.69.138.126]
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35716164
@ECHO OFF

SETLOCAL enabledelayedexpansion

SET Dest=yahoo.com
SET LineStart=100
SET /a LineStartWithHeader=%LineStart% + 3
SET LineEnd=200

FOR /F "skip=%LineStartWithHeader% Tokens=1-7 delims= " %%A IN ('Tracert -h %LineEnd% %Dest% ^| Findstr -v "complete"') DO (
	SET Line=%%A,%%B %%C, %%D %%E,%%F %%G
	SET Line=!Line: =!
	ECHO !Line!
)
	
PAUSE
EXIT

Open in new window

0
 
LVL 10

Accepted Solution

by:
ReneGe earned 1400 total points
ID: 35716179
Or better
 
@ECHO OFF

SETLOCAL enabledelayedexpansion

SET Dest=yahoo.com
SET HeaderLineNumber=3
SET LineStart=100
SET LineEnd=200

FOR /F "skip=%HeaderLineNumber% Tokens=1-7 delims= " %%A IN ('Tracert -h %LineEnd% %Dest% ^| Findstr -v "complete"') DO (
	IF %%A GEQ %LineStart% IF %%A LEQ %LineEnd% (
		SET Line=%%A,%%B %%C, %%D %%E,%%F %%G
		SET Line=!Line: =!
		ECHO !Line!
	)
)
	
PAUSE
EXIT

Open in new window

0
 

Author Comment

by:eli2011
ID: 35716541
it seems to list all the lines regardless if it falls between 100 - 200


C:\batch\testing route>SETLOCAL enabledelayedexpansion

C:\batch\testing route>SET Dest=yahoo.com

C:\batch\testing route>SET HeaderLineNumber=3

C:\batch\testing route>SET LineStart=100

C:\batch\testing route>SET LineEnd=200

C:\batch\testing route>FOR /F "skip=3 Tokens=1-7 delims= " %A IN ('Tracert -h 20
0 yahoo.com | Findstr -v "complete"') DO (IF %A GEQ 100 IF %A LEQ 200 (
SET Line=%A,%B %C, %D %E,%F %G
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 1 GEQ 100 IF 1 LEQ 200 (
SET Line=1,1 ms, 2 ms,1 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 2 GEQ 100 IF 2 LEQ 200 (
SET Line=2,* *, * Request,timed out.
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 3 GEQ 100 IF 3 LEQ 200 (
SET Line=3,12 ms, 6 ms,9 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 4 GEQ 100 IF 4 LEQ 200 (
SET Line=4,6 ms, 8 ms,7 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 5 GEQ 100 IF 5 LEQ 200 (
SET Line=5,54 ms, 55 ms,54 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 6 GEQ 100 IF 6 LEQ 200 (
SET Line=6,67 ms, 68 ms,66 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 7 GEQ 100 IF 7 LEQ 200 (
SET Line=7,81 ms, 80 ms,80 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 8 GEQ 100 IF 8 LEQ 200 (
SET Line=8,148 ms, 97 ms,70 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 9 GEQ 100 IF 9 LEQ 200 (
SET Line=9,91 ms, 85 ms,92 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 10 GEQ 100 IF 10 LEQ 200 (
SET Line=10,79 ms, 85 ms,80 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 11 GEQ 100 IF 11 LEQ 200 (
SET Line=11,95 ms, 95 ms,102 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 12 GEQ 100 IF 12 LEQ 200 (
SET Line=12,108 ms, 113 ms,113 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 13 GEQ 100 IF 13 LEQ 200 (
SET Line=13,107 ms, 114 ms,150 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 14 GEQ 100 IF 14 LEQ 200 (
SET Line=14,109 ms, 126 ms,116 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 15 GEQ 100 IF 15 LEQ 200 (
SET Line=15,117 ms, 178 ms,91 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 16 GEQ 100 IF 16 LEQ 200 (
SET Line=16,109 ms, 92 ms,102 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 17 GEQ 100 IF 17 LEQ 200 (
SET Line=17,104 ms, 114 ms,117 ms
 SET Line=!Line: =!
 ECHO !Line!
) )

C:\batch\testing route>(IF 18 GEQ 100 IF 18 LEQ 200 (
SET Line=18,109 ms, 115 ms,109 ms
 SET Line=!Line: =!
 ECHO !Line!
) )
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35716604
Have you removed "@ECHO OFF"  then piped the output of the batch file to a text file?

If you want to output the result to a file, use the following.

 
@ECHO OFF

SETLOCAL enabledelayedexpansion

SET Dest=yahoo.com
SET HeaderLineNumber=3
SET LineStart=100
SET LineEnd=200

FOR /F "skip=%HeaderLineNumber% Tokens=1-7 delims= " %%A IN ('Tracert -h %LineEnd% %Dest% ^| Findstr -v "complete"') DO (
	IF %%A GEQ %LineStart% IF %%A LEQ %LineEnd% (
		SET Line=%%A,%%B %%C, %%D %%E,%%F %%G
		SET Line=!Line: =!
		ECHO !Line!
		ECHO !Line!>>Output.txt
	)
)
	
PAUSE
EXIT

Open in new window

0
 

Author Comment

by:eli2011
ID: 35716716
ran it exactly as the above and it doesn't create the output.txt file

ran it again with echo on and got the below.  it still shows all values inside of outside of 100-200


C:\batch2>SETLOCAL enabledelayedexpansion

C:\batch2>SET Dest=yahoo.com

C:\batch2>SET HeaderLineNumber=3

C:\batch2>SET LineStart=100

C:\batch2>SET LineEnd=200

C:\batch2>FOR /F "skip=3 Tokens=1-7 delims= " %A IN ('Tracert -h 200 yahoo.com |
 Findstr -v "complete"') DO (IF %A GEQ 100 IF %A LEQ 200 (
SET Line=%A,%B %C, %D %E,%F %G
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 1 GEQ 100 IF 1 LEQ 200 (
SET Line=1,2 ms, 2 ms,2 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 2 GEQ 100 IF 2 LEQ 200 (
SET Line=2,7 ms, 7 ms,7 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 3 GEQ 100 IF 3 LEQ 200 (
SET Line=3,7 ms, 11 ms,7 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 4 GEQ 100 IF 4 LEQ 200 (
SET Line=4,10 ms, 11 ms,11 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 5 GEQ 100 IF 5 LEQ 200 (
SET Line=5,56 ms, 58 ms,58 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 6 GEQ 100 IF 6 LEQ 200 (
SET Line=6,69 ms, 70 ms,69 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 7 GEQ 100 IF 7 LEQ 200 (
SET Line=7,79 ms, 79 ms,79 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 8 GEQ 100 IF 8 LEQ 200 (
SET Line=8,67 ms, 65 ms,68 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 9 GEQ 100 IF 9 LEQ 200 (
SET Line=9,76 ms, 82 ms,76 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 10 GEQ 100 IF 10 LEQ 200 (
SET Line=10,73 ms, 80 ms,86 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 11 GEQ 100 IF 11 LEQ 200 (
SET Line=11,82 ms, 82 ms,77 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 12 GEQ 100 IF 12 LEQ 200 (
SET Line=12,96 ms, 89 ms,89 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 13 GEQ 100 IF 13 LEQ 200 (
SET Line=13,112 ms, 103 ms,110 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 14 GEQ 100 IF 14 LEQ 200 (
SET Line=14,100 ms, 94 ms,99 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 15 GEQ 100 IF 15 LEQ 200 (
SET Line=15,129 ms, 354 ms,125 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 16 GEQ 100 IF 16 LEQ 200 (
SET Line=16,137 ms, 89 ms,129 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 17 GEQ 100 IF 17 LEQ 200 (
SET Line=17,100 ms, 95 ms,100 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 18 GEQ 100 IF 18 LEQ 200 (
SET Line=18,102 ms, 94 ms,100 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 19 GEQ 100 IF 19 LEQ 200 (
SET Line=19,104 ms, 107 ms,113 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>(IF 20 GEQ 100 IF 20 LEQ 200 (
SET Line=20,108 ms, 114 ms,112 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>Output.txt
) )

C:\batch2>PAUSE
Press any key to continue . . .
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35716730
Works well for me. I tried this on a Windows 7 and XP Pro PC.

What is your OS?
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35716745
Run this script and tell me what you get.
 
@ECHO OFF

SETLOCAL enabledelayedexpansion

SET Var=a,b

FOR %%A IN (%Var%) DO (
	SET Val=VALUE=%%A
	ECHO !Val!
)

PAUSE

Open in new window

0
 

Author Comment

by:eli2011
ID: 35716758
VALUE=a
VALUE=b
Press any key to continue...
0
 

Author Comment

by:eli2011
ID: 35716759
i'm using win7
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35716769
So enabledelayedexpansion works

What if create is but somehow, in another folder?

Try this insted. This will force the output file to be in the batch file folder, and named with that batch file name with the TXT extension.

 
@ECHO OFF

SETLOCAL enabledelayedexpansion

SET Dest=yahoo.com
SET HeaderLineNumber=3
SET LineStart=100
SET LineEnd=200

FOR /F "skip=%HeaderLineNumber% Tokens=1-7 delims= " %%A IN ('Tracert -h %LineEnd% %Dest% ^| Findstr -v "complete"') DO (
	IF %%A GEQ %LineStart% IF %%A LEQ %LineEnd% (
		SET Line=%%A,%%B %%C, %%D %%E,%%F %%G
		SET Line=!Line: =!
		ECHO !Line!
		ECHO !Line!>>"%~dpn0.txt"
	)
)
	
PAUSE
EXIT

Open in new window

0
 

Author Comment

by:eli2011
ID: 35716999
i tried it from an xp machine with a new OS

got this same thing shows all ranges of numbers and doesn't create the output file.  though it shows like it takes the name of the bat file to try creating the .txt file


C:\>SETLOCAL enabledelayedexpansion
C:\>SET Dest=yahoo.com
C:\>SET HeaderLineNumber=3
C:\>SET LineStart=100
C:\>SET LineEnd=200
C:\>FOR /F "skip=3 Tokens=1-7 delims= " %A IN ('Tracert -h 200 yahoo.com | Finds
tr -v "complete"') DO (IF %A GEQ 100 IF %A LEQ 200 (
SET Line=%A,%B %C, %D %E,%F %G
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
 LEQ 200 (F
, ,  ,
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 1 GEQ 100 IF 1 LEQ 200 (
SET Line=1,9 ms, <1 ms,<1 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 2 GEQ 100 IF 2 LEQ 200 (
SET Line=2,9 ms, 9 ms,9 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 3 GEQ 100 IF 3 LEQ 200 (
SET Line=3,9 ms, 9 ms,12 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 4 GEQ 100 IF 4 LEQ 200 (
SET Line=4,11 ms, 12 ms,31 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 5 GEQ 100 IF 5 LEQ 200 (
SET Line=5,12 ms, 44 ms,15 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 6 GEQ 100 IF 6 LEQ 200 (
SET Line=6,24 ms, 12 ms,12 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 7 GEQ 100 IF 7 LEQ 200 (
SET Line=7,10 ms, 12 ms,12 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 8 GEQ 100 IF 8 LEQ 200 (
SET Line=8,46 ms, 43 ms,37 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 9 GEQ 100 IF 9 LEQ 200 (
SET Line=9,89 ms, 91 ms,114 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 10 GEQ 100 IF 10 LEQ 200 (
SET Line=10,87 ms, 102 ms,86 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 11 GEQ 100 IF 11 LEQ 200 (
SET Line=11,88 ms, 86 ms,79 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 12 GEQ 100 IF 12 LEQ 200 (
SET Line=12,87 ms, 85 ms,84 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 13 GEQ 100 IF 13 LEQ 200 (
SET Line=13,100 ms, 88 ms,101 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 14 GEQ 100 IF 14 LEQ 200 (
SET Line=14,96 ms, 89 ms,88 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>(IF 15 GEQ 100 IF 15 LEQ 200 (
SET Line=15,85 ms, 103 ms,90 ms
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
 LEQ 200 (F
, ,  ,
 SET Line=!Line: =!
 ECHO !Line!
 ECHO !Line! 1>>"C:\test1.txt"
) )
C:\>PAUSE
Press any key to continue . . .
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35717014
"though it shows like it takes the name of the bat file to try creating the .txt file" = This is by design.

I'm puzzled about your issue here.

Let's see what other experts has to say about this.

Cheers,
Rene
0
 

Author Comment

by:eli2011
ID: 35717056
sorry for the trouble
thanks

i am going to try it on a w2k3 server, btw.
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35717069
Let me know how it goes.
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35717077
FYI: Just tried it on another XP and w2003 server. Worked well.
0
 

Author Comment

by:eli2011
ID: 35720445
ok it's definitely not working for me, tried from xp, win7 and 2k3 server.  i'm just copying the script and pasting it exactly as it.  i attached it just in case .  the file creation is secondary for me, but you are saying that for you it displays only lines within the range specified?  cuz i get all lines TRtest.txt
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35720724
What is your batch file name?
0
 

Author Comment

by:eli2011
ID: 35721380
trtest.bat
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35721990
For a command prompt, try running it with the following command line:
CMD /V:ON "C:\Batch File Path\trtest.bat"
0
 
LVL 14

Assisted Solution

by:Don Thomson
Don Thomson earned 600 total points
ID: 35722210
In your IF statement your IF %%A   only tests the actual line number
If you change it to
IF %%B GEQ %LineStart% if %%B LEQ %LineEnd% (

Then it tests the values of Column 2  use %%c  or %%D for columns 3 or 4
0
 
LVL 14

Expert Comment

by:Don Thomson
ID: 35722243
Part 2 of above (Hit Submit before I was done - Sorry)

Since your start and end points are 100 and 200 - Testing the line number will always product no txt file as the maximum number of hops over a tracert should never be more than 30  (15 levels of network up and 15 down)   Anything past that means something is really screwed up (i.e.) you would have to be going through a private network that went through some 70 routers before it actually hit the internet)

0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35723387
@DTHConsulting:
-Testing other columns was not a requirment.
-100 <> 200 : I was to focused on the requirments. I did not analyse it's raisability/limmitations. You are right and actually, I performed my test with a range of 2<>3.

@eli2011:
Would you mind running this command line and share the it's result with us as a attached file?
tracert yahoo.ca >C:\Tracert.txt
0
 

Author Comment

by:eli2011
ID: 35724367
When i changed it to this it worked.  created the file too
IF %%B GEQ %LineStart% if %%B LEQ %LineEnd% (
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35724668
Interesting. If the line number is in the first column, and the FOR command starts with %%A, I wonder how then the line number end's up in the variable %%B.
0
 
LVL 10

Expert Comment

by:ReneGe
ID: 35732745
Glad I could help.
0
 

Author Comment

by:eli2011
ID: 35733879
Thanks guys
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Phishing emails are a popular malware delivery vehicle for attack.  While there are many ways for an attacker to increase the chances of success for their phishing emails, one of the most effective methods involves spoofing the message to appear to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question