當前位置:首頁 » 編程軟體 » 腳本窗口最小化運行

腳本窗口最小化運行

發布時間: 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.

熱點內容
上傳到哪了 發布:2024-04-18 19:45:08 瀏覽:317
一觸即發手機軟體復雜腳本 發布:2024-04-18 19:24:29 瀏覽:39
linux查看文件數 發布:2024-04-18 19:19:17 瀏覽:338
linux下qt編譯兩個小時 發布:2024-04-18 18:56:24 瀏覽:546
python27安裝庫 發布:2024-04-18 18:48:51 瀏覽:24
hashjava 發布:2024-04-18 18:40:48 瀏覽:174
c語言可以在 發布:2024-04-18 18:34:09 瀏覽:391
汽車如何配置導航 發布:2024-04-18 18:23:13 瀏覽:140
北大訪問學者 發布:2024-04-18 18:23:12 瀏覽:858
php寫入一行 發布:2024-04-18 17:57:01 瀏覽:860