当前位置:首页 » 编程软件 » 脚本窗口最小化运行

脚本窗口最小化运行

发布时间: 2022-12-06 02:15:21

‘壹’ 想把用按键精灵9后台脚本运行的窗口最少化,或可在其它窗口进操作。

目前看情况,没问题,请把你的完整脚本贴出来,并说明用途和对应的到底是什么程序
要知道,不是所有程序,都支持后台的,特别是完全最小化.
有的窗口,激活状态,后台模式生效,切换到后台,后台模式就不生效.,而有的窗口,是最小化不生效,更有甚者是后台模式直接无效的
所以,需要了解清楚情况才行

‘贰’ 让bat最小化运行

bat文件运行时会有一个黑黑的cmd.exe窗口,很吓人,就算用start/min命令去运行bat文件,电脑的任务栏下仍然会有相关的图标,怎么让bat文件在后台无声无息无影无形地运行呢?以下的办法可以达到你的目的。

方法一
bat里有隐藏窗口的命令,很简单,只需要在代码头部加一段代码就可以了。
@echo off
if "%1" == "h" goto begin
mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit
:begin
::下面是你自己的代码。

方法二
在你批处理的相同目录下新建一个记事本,里面输入:
DIM objShell set objShell=wscript.createObject("wscript.shell")
iReturn=objShell.Run("cmd.exe /C c:\1.bat", 0, TRUE)
(其中win.bat为你自己的批处理名字,自己改)
然后把这个记事本保存为后缀名为.vbe的文件,到时候你只要运行这个vbe文件就达到目的了!
可以写的简单点:
Set ws = CreateObject("Wscript.Shell")
ws.run "cmd /c c:\1.bat",0
或者
CreateObject("WScript.Shell").Run "cmd /c c:\1.bat",0
(这种写法很多杀软报毒, 需要替换参数0)
最后那个0是指窗口参数,用法为:
0 隐藏窗口并激活另一窗口。
1 激活并显示一个窗口。若窗口是最小化或最大化,则恢复到其原来的大小和位置。
2 激活窗口并以最小化显示该窗口。
3 激活窗口并以最大化显示该窗口。
4 按窗口最近的大小和位置显示。活动窗口保持活动。
5 以当前大小和位置激活并显示窗口。
6 最小化指定窗口并激活按 Z 序排序的下一个顶层窗口。
7 最小化显示窗口。活动窗口保持活动。
8 以当前状态显示窗口。活动窗口保持活动。
9 激活并显示窗口。若窗口是最小化或最大化,则恢复到原来的大小和位置。在还原应用程序的最小化窗口时,应指定该标志。
如果不能解决,请继续追问~,如果已经解决,请选择满意答案~谢谢~</SPAN></SPAN>

‘叁’ vbs脚本文件里最小化当前窗口得命令是什么

Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run "cmd.exe",2

‘肆’ 窗口最小化后仍然可以运行的脚本

hwnd = Plugin.Window.MousePoint()
Delay 1000
While true
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 49)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 50)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 51)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 52)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 53)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 54)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 55)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 56)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 38)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 8)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 57)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 113)
Delay 1000
Call Plugin.Bkgnd.KeyPress(hwnd, 13)
Delay 5000
Wend
这样可以么?

‘伍’ 最小化指定窗口 VBS脚本

脚本如下:
Const strTitle = "完整的窗口标题"

Dim objShell

Set objShell = CreateObject("Wscript.Shell")

While True
If objShell.AppActivate(strTitle) Then

Wscript.Sleep 250

objShell.SendKeys "% "
objShell.SendKeys "n"
Set objShell = Nothing
Wscript.Quit
End If
Wend

把代码中的strTitle设为需要检测的窗口的完整标题即可。
如果想停止检测,就到任务管理器里面将进程“wscript.exe”结束即可。

_____________________
补充:
不过类似这样的需求(等待窗口、控制窗口状态等),用AutoIt实现是最方便的。AutoIt也有其它很多强大的功能,楼主如果感兴趣可以在网上搜索一下“AutoIt”看看,是免费的。

‘陆’ 我录了个脚本但是不知道怎么样锁定窗口最小化运行

像这些小玩意自己随便用易语言或是Delphi去写出来就OK.

热点内容
如何猜对方qq密码后几位 发布:2024-05-02 03:46:59 浏览:403
php最后出现字符串 发布:2024-05-02 03:46:31 浏览:492
android源码debug 发布:2024-05-02 03:41:13 浏览:437
python离线安装包 发布:2024-05-02 03:10:42 浏览:920
君越配置有哪些 发布:2024-05-02 03:10:41 浏览:453
哪里有java培训 发布:2024-05-02 02:35:56 浏览:503
iis其他电脑访问 发布:2024-05-02 02:22:14 浏览:183
ios执行python脚本 发布:2024-05-02 02:12:45 浏览:619
内网怎么在公网访问 发布:2024-05-02 02:05:26 浏览:250
电脑版我的世界服务器推荐模组 发布:2024-05-02 02:05:25 浏览:699