如何在Windows 10中實際啟動最小化的程式?

如何在Windows 10中實際啟動最小化的程式?

我嘗試使程式(例如:Thunderbird)在啟動時加載的步驟,但最小化:

  1. 捷徑放置在:C:\Users\使用者名稱\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  2. 在快捷方式屬性中,我檢查了“最小化”

重新啟動Windows,它確實啟動了,但是最大化了!無法將其最小化,就像在 MacOS 上一樣,我可以將其設為隱藏。

答案1

你的方法似乎不適合我。您可以建立一個在使用者登入時執行的排程任務,並附加下列批次 (.bat) 檔案。

start /min "" "C:\Program Files\Mozilla\Thunderbird.exe"

然後,您可以透過應用程式資料路徑停用 Thunderbird 程式在啟動時運行。

程式碼的其他選項:

將其另存為 .ps1

@echo off
start thunderbird
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('*Mozilla Thunderbird')
Sleep 2
$wshell.SendKeys('(%(" "(n)))')

**確保當 Thunderbird 打開時,設定電子郵件箱不存在(用戶端已配置)並且不會提示您使用預設郵件應用程式。

答案2

在我更改語法順序後,它對我有用:Start-Process -WindowStyle Minimized thunderbird。這似乎是一個錯誤:規定的語法順序(請參閱 參考資料Get-Help Start-Process)與實際有效的語法順序不同。

答案3

以下是我新增到 Windows 8.1 啟動配置中的腳本。

'
' A VBS script to start Thunderbird minimized to the tray at boot time.
'
' Thunderbird is unusual in that the GUI minimize hyphen (-) button already takes it
' to the tray rather than the task bar like most other programs. All this script has
' to do is open Thunderbird normally and immediately minimize it using the hotkey
' sequence ALT+SPACE+N.
'
' Create the WSH hosting environment
Set objShell = WScript.CreateObject("WScript.Shell")
'
' Open Thunderbird
Set objShellApp = CreateObject("Shell.Application")
objShellApp.ShellExecute "C:\Program Files\Mozilla Thunderbird\thunderbird.exe", "", "", "", 1
'
' Force Thunderbird to become the active window.
Do Until Activated
    Activated = objShell.AppActivate("Mozilla Thunderbird")
Loop
'
' Send the hotkey sequence to minimize the active window.
objShell.SendKeys "% N"
'
' All done. Thunderbird collapses to an icon in the system tray.

' To do this at system boot time, a shortcut to "Start_TBird_Minimized.vbs" is placed
' in the Windows startup folder, typically located here:
'       %USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
'
WScript.Quit 0

相關內容