Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>wouldnt it be best to run the ping command prior to building the html file?</p> <p>like this (obvioulsy change the 127.0.0.1 to your server #)</p> <pre><code>@echo off setlocal enabledelayedexpansion enableextensions set count=0 for /f "delims=" %%a in ('ping -n 4 127.0.0.1') do ( set /a count=!count!+1 set pingrspn!count!=%%a ) echo Response1: !pingrspn4! echo Response2: !pingrspn5! echo Response3: !pingrspn6! echo Response4: !pingrspn7! </code></pre> <p>now you can use the vars: pingrspn4-pingrspn7 in your "build an html file" script.</p> <p>nice idea though on the build an html on the fly, i like it.</p> <p>One question on the /format option on the ping line, i notice that ping does not have a /format parameter, so is the /format option coming from the redirect symbol?</p> <p>[edit] so i tweaked your file (you had some missing html code) to format the results (server.html) pages</p> <pre><code> :: setlocal options setlocal enabledelayedexpansion enableextensions set count=0 for /f "delims=" %%a in ('ping -n 4 127.0.0.1') do ( set /a count=!count!+1 set pingrspn!count!=%%a ) echo Response1: !pingrspn4! echo Response2: !pingrspn5! echo Response3: !pingrspn6! echo Response4: !pingrspn7! :: write results file echo ^&lt;HTML^&gt;^&lt;HEAD^&gt;&lt;TITLE^&gt;SERVER PING INFO^&lt;/TITLE^&gt;^&lt;/HEAD^&gt; &gt;&gt;ping-results.html echo ^&lt;BODY GBCOLOR=#FFFFFF” TEXT=”#000000” LINK+#0000FF” VLINK=#800080”^&gt; &gt;&gt;ping-results.html echo ^&lt;p align="center"^&gt;^&lt;table border="1" width="600"^&gt; &gt;&gt;ping-results.html echo ^&lt;tr^&gt;^&lt;td^&gt;^&lt;B^&gt;ping results^&lt;/td^&gt; &gt;&gt; ping-results.html for /F %%i in (serverIP.txt) do ( echo Processing %%i... :: already ran the ping command, so rem it out rem ping.exe "%%i" &gt; "%%i.html" /format:htable.xsl :: write %%i.html echo ^&lt;HTML^&gt;^&lt;HEAD^&gt;&lt;TITLE^&gt;Individual PING^&lt;/TITLE^&gt;^&lt;/HEAD^&gt; &gt;%%i.html echo ^&lt;BODY GBCOLOR=#FFFFFF” TEXT=”#000000” LINK+#0000FF” VLINK=#800080”^&gt; &gt;&gt;%%i.html echo ^&lt;p align="center"^&gt;^&lt;table border="1" width="600"^&gt; &gt;&gt;%%i.html echo ^&lt;tr^&gt;^&lt;td^&gt;^&lt;B^&gt;results^&lt;/td^&gt; &gt;&gt; %%i.html echo ^&lt;tr^&gt;^&lt;td^&gt;!pingrspn4! ^&lt;^/td^&gt;^&lt;^/tr^&gt; &gt;&gt; %%i.html echo ^&lt;tr^&gt;^&lt;td^&gt;!pingrspn5! ^&lt;^/td^&gt;^&lt;^/tr^&gt; &gt;&gt; %%i.html echo ^&lt;tr^&gt;^&lt;td^&gt;!pingrspn6! ^&lt;^/td^&gt;^&lt;^/tr^&gt; &gt;&gt; %%i.html echo ^&lt;tr^&gt;^&lt;td^&gt;!pingrspn7! ^&lt;^/td^&gt;^&lt;^/tr^&gt; &gt;&gt; %%i.html echo ^&lt;^/body^&gt; ^&lt;^/table^&gt; ^&lt;^/html^&gt; &gt;&gt; %%i.html echo ^&lt;tr^&gt;^&lt;td^&gt;%%i^&lt;/td^&gt; &gt;&gt; ping-results.html echo ^&lt;td^&gt;^&lt;a href="%%i.html"^&gt;Results^&lt;/a^&gt;^&lt;/td^&gt; &gt;&gt; ping-results.html echo ^&lt;/tr^&gt; &gt;&gt; ping-results.html ) echo ^&lt;p align="center"^&gt;^&lt;b^&gt;^&lt;font size="+1" color="Red"^&gt;^&lt;BR^&gt;Completed at &gt;&gt; ping-results.html time /T &gt;&gt; ping-results.html echo - on &gt;&gt; ping-results.html date /T &gt;&gt; ping-results.html echo ^&lt;/font^&gt;^&lt;/b^&gt;^&lt;BR^&gt;^&lt;/p^&gt; &gt;&gt; ping-results.html echo ^&lt;^/body^&gt; ^&lt;^/table^&gt; ^&lt;^/html^&gt; &gt;&gt; ping-results.html echo DONE!! ping-results.html </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload