在 Windows 启动时运行固定任务栏应用程序?

问题描述 投票:0回答:2

如何运行启动时固定到任务栏的所有应用程序?

看起来是一个理想的功能。我固定应用程序是因为 Windows 登录后我会单击所有应用程序。

批处理文件不走运:

for %1 in (%AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.ink) do "%1"
windows batch-file autohotkey startup
2个回答
0
投票
  • 创建一个自动热键脚本并将以下代码添加到其中:

     Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
         Run %A_LoopFilePath%,, UseErrorLevel
    
  • 运行“shell:startup”或在资源管理器栏中输入它以导航到启动文件夹并在其中放置保存的脚本文件的快捷方式。

编辑:

要排除不需要的窗口或跳过已经运行的进程,请尝试以下操作:

Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
{   
    FileGetShortcut, %A_LoopFilePath%, path
    ; MsgBox, %path%
    SplitPath, path, name
    ; MsgBox, %name%

    If (name = "")
        continue

    ; exclude unwanted windows
    If name contains mspicons.exe,OneDrive.exe
        continue

    ; skip already running processes
    If WinExist("ahk_exe" name)
        continue

    Run %A_LoopFilePath%,, UseErrorLevel
}

0
投票
Loop Files, %A_AppData%\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar\*.lnk
{
    FileGetShortcut, %A_LoopFileLongPath%, ShortcutTarget
    SplitPath, ShortcutTarget, , , , name
    Process, Exist, %name%.exe
    If (!ErrorLevel)
    {
        Run, %ShortcutTarget%
    }
}
return

这最终成为最好的解决方案。

© www.soinside.com 2019 - 2024. All rights reserved.