在所有窗口的顶部bat文件 [英] Bat file on top of all windows

查看:154
本文介绍了在所有窗口的顶部bat文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在寻找一个命令,将始终保持在所有其他窗口上方的命令提示符下,使我的批处理脚本将始终可见,不管其他窗口有多少打开。

I'm looking for a command that will always keep the command prompt on top of all other windows so that my batch script will always be visible, no matter how many other windows are opened.

我一直没能在网上找到关于这个的任何地方的任何信息,因此任何帮助将大大AP preciated。

I have not been able to find any information on this anywhere online, so any help would be greatly appreciated.

推荐答案

我能提供的最好的是则AppActivate 方法从 WScript.Shell 。这将需要JScript或vbscript.Here同批次/ JScript的一个例子hybrid.You可以测试是否works.You可以把使用AppActivate环路,以确保意志窗口将顶得上:

The best I can offer is appActivate method from WScript.Shell. this will require jscript or vbscript.Here's an example with batch/jscript hybrid.You can test if it works.You can put the appActivate in loop to be sure the will window will get on top:

@if (@X)==(@Y) @end /* JScript comment 
        @echo off 
        rem title is needed so the appActivate to be able to recognize the current shell
        title ###

        rem waiting so we'll have time to switch the windows
        ping 192.0.2.1 -n 1 -w 10000 >nul 2>nul

        rem the jscript part with the appActivate is called
        cscript //E:JScript //nologo "%~f0"  %*

        rem checking the result
        echo are we on top?
        pause

        exit /b %errorlevel% 
@if (@X)==(@Y) @end JScript comment */ 

var sh=new ActiveXObject("WScript.Shell");
WScript.Echo(sh.AppActivate("###"));  

这篇关于在所有窗口的顶部bat文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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