【发布时间】:2014-12-02 11:40:25
【问题描述】:
我运行多个批处理文件来监控我的网络链接。我有下面的一组代码。我运行一个批处理文件来一次打开所有文件。然后我必须将它们重新定位在屏幕顶部,以便我可以打开 Internet Explorer 以在屏幕底部显示太阳风。我想添加到我用来设置每个窗口打开位置的代码中。提前感谢您的帮助。
@echo off
TITLE = VoIP Link
mode 50,20
setlocal enableextensions enabledelayedexpansion
rem Get address from command line
set "address=13.2.9.6"
if not defined address set "address=127.0.0.1"
rem Configure levels and colors
rem The format is initialValue:color in value descending format
set "levels=9000:4F 178:E0 146:2F 0:E0"
rem infinite loop
for /l %%i in () do (
rem retrieve information from ping command
set "rtt=Timed Out"
set "ttl=?"
for /f "tokens=3,4 delims==^<" %%a in (
'ping -n 1 "%address%" ^| find "TTL="'
) do for /f "tokens=1 delims=m" %%c in ("%%a") do (
set /a "rtt=%%c"
set "ttl=%%b"
)
rem retrieve color
set "color="
for %%z in (%levels%) do for /f "tokens=1,2 delims=:" %%a in ("%%z") do (
if not defined color if !rtt! geq %%a set "color=%%b"
)
rem show information
if defined color color !color!
echo(!time! - %address% - rtt[!rtt!]
rem save to log
for /f "tokens=1-4 delims=.:-/ " %%a in ("!date!") do (
>> "%%b-%%c-%%d_%%a_VOIP Link 1.txt" echo(!date! - !time! - %address% - rtt[!rtt!]
)
rem wait and repeat the process
ping -n 3 localhost >nul 2>nul
)
【问题讨论】:
-
也许this 可以提供帮助
标签: windows batch-file ping window-resize