调整批处理窗口的大小并在特定位置设置 [英] Size batch windows and set in specific location

查看:2011
本文介绍了调整批处理窗口的大小并在特定位置设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我运行着多个批处理文件来监视我的网络链接.我有下面的代码集之一.我运行一个批处理文件以一次打开所有文件.然后,我必须将它们重新放置在屏幕顶部,以便可以打开Internet Explorer在屏幕底部显示太阳风.我想添加到我用来设置每个窗口打开位置的代码中.预先感谢您的帮助.

I have multiple batch files I run to monitor my network links. I have one of the sets of code below. I run a single batch file to open all the files at once. I then have to reposition them across the top of the screen so I can open internet explorer to display solar winds across the bottom portion of the screen. I want to add to the code I am using to set where each window will open. Thank you in advance for the help.

@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 
    )

推荐答案

如果您这样启动每个窗口

If you start each window like this

start "A Window Title" cmd /k <optional command>

转到窗口的属性.设置大小和颜色,取消选择让Windows位置.

Goto the Window's properties. Set size and colour, untick Let Windows Position.

将来以相同的方式启动它时,它会记住它的大小和颜色.

When you start it the same way in the future it will remember it's size and color.

这篇关于调整批处理窗口的大小并在特定位置设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆