如何在 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"

然后,您将通过 appdata 路径禁用 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

相关内容